AJAX. . AJAX, .
Implicit Wait Explicit Wait, -, . , , .
:
, , , . , .
:
WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(strEdit)));
WebElement myDynamicElement = (new WebDriverWait(driver, 30))
.until(new ExpectedCondition<WebElement>(){
@Override
public WebElement apply(WebDriver d) {
return d.findElement(By.id("myDynamicElement"));
}});
30 , TimeoutException , 0-30 . WebDriverWait ExpectedCondition 500 , . ExpectedCondition - Boolean return true not null ExpectedCondition.
ExpectedConditions , .
:
WebDriver DOM ,
:
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
, , , - WebDriver
http://seleniumhq.org/docs/04_webdriver_advanced.jsp
You can use these waits during your AJAX loading.
, .