How can I check whether a given text string is present on the current page using Selenium?
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!");
1.4m articles
1.4m replys
5 comments
57.0k users