如何使用Selenium检查当前页面上是否存在给定的文本字符串?
代码是这样的:
def elem = driver.findElement(By.xpath("//*[contains(.,'search_text')]")); if (elem == null) println("The text is not found on the page!");