Selenium WebDriver Page Reload or Ajax
- ajax
see the reference :
1) Working with Ajax controls using Webdriver : http://seleniumeasy.com/selenium-tutorials/how-to-work-with-ajax-controls-using-webdriver
2) WebDriver Waits Examples :
http://seleniumeasy.com/selenium-tutorials/webdriver-wait-examples
as you can see above link, you just use WebDricverWait class
WebDriverWait wait = new WebDriverWait(driver, waitTime);
wait.until(ExpectedConditions.presenceOfElementLocated(locator));
page reload
see the reference :
1) Slanec ‘s anser : http://stackoverflow.com/questions/15122864/selenium-wait-until-document-is-readyHe is saying that Selenium by default tries to wait for those (and a little bit more) on page loads via the driver.get() and element.click() methods.
2) Slanec ‘s anser (there are code for page reload):
http://stackoverflow.com/questions/11001030/how-i-can-check-whether-page-is-loaded-completely-or-not-in-web-driver/11002061#11002061
WebDriverWait wait = new WebDriverWait(driver, 10); // you can reuse this one
WebElement elem = driver.findElement(By.id("myInvisibleElement"));
elem.click();
wait.until(ExpectedConditions.visibilityOf(elem));
댓글 없음:
댓글 쓰기