Element Locators using XPath
Expressions
1 | xpath=xpathExpression |
1 2 3 4 5 6 7 | xpath= //img[@alt='The image alt text'] xpath= //table[@id='table1']//tr[4]/td[2] xpath= //a[contains(@href,'#id1')] xpath= //a[contains(@href,'#id1')]/@class xpath=( //table[@class='stylee'])//th[text()='theHeaderText']/../td xpath= //input[@name='name2' and @value='yes'] xpath= //*[text()="right"] |
DOM – Javascript
1 | xpath=xpathExpression |
1 2 3 | dom=document.forms[ 'myForm' ].myDropdown dom=document.images[ 56 ] dom=function foo() { return document.links[ 1 ]; }; foo(); |