writing xpath expressions code example Example 1: html xpath name //input[@name='username'] Example 2: relative xpath sample //input[@id=’user-message‘]