Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

0
i need example to fluent wait with package import

Solved 1 Answers 196 Views Test Automation
0 1
I have got plunty of examples to implement fluent wait, but I have not seen example with what are the package to be imported. Kindly post list of packages to be imported with fluent wait

1 Answer

0
Best answer
0

Packages to be imported:

import java.util.concurrent.TimeUnit;
 
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.FluentWait;
import org.openqa.selenium.support.ui.Wait;
 
import com.google.common.base.Function;
 
Wait sample:
 
Wait<WebDriver> wait
= new FluentWait<WebDriver>(driver)
.withTimeout(60, TimeUnit.SECONDS)
.pollingEvery(5, TimeUnit.SECONDS)
.ignoring(NoSuchElementException.class)
.ignoring(StaleElementReferenceException.class);
 
WebElement eleVendorId =
wait.until(new Function<WebDriver, WebElement>() {
 
public WebElement apply(WebDriver driver) {
return driver.findElement(byvendor_id);
}
});
 
 
 
answered by
selected by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
...