2015년 7월 6일 월요일

Selenium WebDriver Page Reload or Ajax

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));

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));

댓글 없음:

댓글 쓰기