我想使用 assertTrue() 验证文本是否存在,但我收到 StackOverflow 错误。我不确定我写的代码是否正确。需要您的建议。
// Checking the posted text
WebElement postedtext= driver.findElement(By.cssSelector("css123"));
assertTrue("The text is verfied",postedtext.getText().equals(enteredText));
private static void assertTrue(String string, boolean equals) {
assertTrue(string,equals);}
最佳答案
您有一个名为 assertTrue(s, b)
的方法,它会调用自身。这会导致无限递归。
关于java - 使用 assertTrue() 验证 selenium 中文本的存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48106595/