Finding text on page with Selenium 2

0
0

How can I check whether a given text string is present on the current page using Selenium?

  • You must to post comments
0
0

The code is this:

def elem = driver.findElement(By.xpath("//*[contains(.,'search_text')]")); 
if (elem == null) println("The text is not found on the page!");
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website