A td tag with the text “Settings” for example:
//td[contains(text(), 'Settings')]
Another example:
//div[contains(.,'Some Text')]
Sometimes there are cross-browser problems with using XPath. One solution is to get all elements with a specific tag name, and iterate through the list to match the values of specific attributes.
Leave a comment