Reputation: 50722
For AJAX application testing, is there a waitForText()
method using Selenium WebDriver?
Basically, I need to test for refreshed/new element/text value post AJAX request.
Is an example of this available?
Upvotes: 1
Views: 2174
Reputation: 27496
Just do
WebElement myDynamicElement = (new WebDriverWait(driver, 10))
.until(ExpectedConditions.textToBePresentInElement(By.id("idOfElement")));
where 10
is timeout for polling, JavaDoc.
Upvotes: 5