3 ms·
>Is there a better solution Yes. And it's pretty simple: WebDriver driver = new FirefoxDriver(); driver.get("http://somedomain/url_that_delays_loading
by crdoconnor 11y ago
>Is there a better solution
Yes. And it's pretty simple:
WebDriver driver = new FirefoxDriver();
driver.get("http://somedomain/url_that_delays_loading");
WebElement myDynamicElement = (new WebDriverWait(driver, 10))
.until(ExpectedConditions.presenceOfElementLocated(By.id("myDynamicElement")));
From : http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp
- drothlis 11y agoI'm not sure this satisfies your parent poster's requirement of: "if it fails, you know about it pretty soon, without the need for long timeouts."
- crdoconnor 11y agoWell, you need to have a timeout. You can make the timeout shorter when running the test on a dev environment, though, so you get quicker feedback about errors.