<table id="table1"> <form method="POST" action="#"> <tbody> <tr><td>Name: </td><td><input type="text" id="name" size="20"></td></tr> <tr><td>Email Address: </td><td><input type="text" name="email" size="20"></td></tr> <tr><td><input type="submit" value="Submit" class="button"></td></tr> </tbody> </table>
Xpath Locator based on id of element:
For example,
xpath=//input[@id='name']
Xpath Locator based on name of element:
For example,
xpath=//input[@name='email']
Xpath Locator based on class of element:
For example,
xpath=//input[@class='button']
Xpath Locator based on value of element:
For example,
xpath=//input[@value='Submit ']
Xpath Locator based on containing text by element:
For example,
xpath=//p[contains(text(),'Name')]
0 Comments
What would you like to add in my list? I look forward to reading your comments below.