Contains Text //a (Contains (Text ,'text') ) Tags: // (@type 'Text') /following::input
Contains Text //a (Contains (Text ,'text') ) Tags: // (@type 'Text') /following::input
Contains Text //a (Contains (Text ,'text') ) Tags: // (@type 'Text') /following::input
Text //a[contains(text(),'text')]
Tags //a[contains(@id,'id')]
//a[contains(@className,'className')]
//a[contains(.,'text')]
OR //*[@id='id' OR @class='class']
starts-with //*[starts-with(@id,'id')]
//input[starts-with(@name,'txt') OR @id='txtUsername']
text() //td[text()='text']
//li/a[text()='Performance']
Following //*[@type='text']/following::input
Peceding //div[@id='idester']/preceding::div
Descendant //div[@id='id']/descendant::a
following-sibling //a[@id='menu-item']/following-sibling::a
Preceding-sibling //form[@id='frmSelectEmployees']/preceding-sibling::div
Parent //div[@id='branding']/parent::div
Self //*[@id='aboutDisplayLink']//self::a
Both the conditions should be true,It fails to find element if any one condition is false
Any one condition should be true, it fails to find element if both conditions are false
Start-with function finds the element whose attribute value changes on refresh or any operation on the webpage
http://www.guru99.com/xpath-selenium.html
Select the following siblings of the context node. Siblings are at the same level of the current node
It will find the element after the current node.
Select the Previous siblings of the context node. Siblings are at the same level of the current node
It will find the element after the current node.
(for following and precding will work only for nodes at same level)
Selects the current node or 'self' means it indicates the node itself
The ancestor axis selects all ancestors element (grandparent, parent, etc.) of the current node
y operation on the webpage