Monday, 4 July 2016

How to verify if text is present on a web page in Selenium

We can use below xpath selector to verify if the text is present on a web page in Selenium.

//*[contains(text(),'text data')]

Note that above xpath will identify text wrapped in any element like div, span etc.
Only condition is that text should be inside one specific tag.


What do you think on above selenium topic. Please provide your inputs and comments. You can write to me at reply2sagar@gmail.com

No comments:

Post a Comment

Buy Best Selenium Books