我一直在使用 Selenium WebDriver。我想等到该元素出现在我正在使用的网页上:
WebDriverWait wait = new WebDriverWait(driver, Long.parseLong(timeout));
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locator)));
但是如果我正在寻找的元素不存在甚至超过超时,我的测试就会卡在第二行。请帮忙。谢谢。