Best way to check that element is not present using Selenium WebDriver with java

后端 未结 9 1957
半阙折子戏
半阙折子戏 2020-12-24 02:33

Im trying the code below but it seems it does not work... Can someone show me the best way to do this?

public void verifyThatCommentDeleted(final String text         


        
9条回答
  •  既然无缘
    2020-12-24 03:03

    WebElement element = driver.findElement(locator);
    Assert.assertNull(element);
    

    The above assertion will pass if element is not present.

提交回复
热议问题