Xpath Contains
Xpath Contains
By using 'contains' function in XPath, we can extract all the elements which
matches a particular text value.
"//h4/a[contains(text(),'SAP M')]"
Sibling:
Using sibling keyword, we can fetch a web element on the which is related to some
other element.
"//div[@class='canvas- graph']//a[@href='/accounting.html'][i[@class='icon-
usd']]/following-sibling::h4"
Ancestor:
To find an element on the basis of the parent element we can use ancestor
attribute of XPath.
"//div[.//a[text()='SELENIUM']]/ancestor::div[@class='rt-grid-2
rt-omega']/following-sibling::div"