Find Web Element By Text

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

Learnings in Webdriver using C#.Net

Webdriver Tips and Techniques

The Automation Tester

My experiance with test automation

Learn WebDriver

This WordPress.com site is the cat’s pajamas

Assert Selenium

Selenium Automation in a Right Way