Please Tell me The Fluent Wait | Selenium Forum
T
toparveensharma Posted on 27/06/2019

TRAINING VIDEO - 15

 

In this it is being discussed that waits are

1. Implicit Wait

2 Explicit Wait

3 Thread. Sleep

While searching on web I aslo came to know about FluentWait

is there any Tutorial or Video on it.

kindly let me know about it.

Thanks & Regards

Parveen


A
Ashish Thakur Replied on 28/06/2019

WebDriver Wait is equivalent to Fluent Wait. You can use webdriver wait for this.


T
toparveensharma Replied on 29/06/2019

Explicit wait: Explicit wait is of two types:

1) WebDriverWait

2) FluentWait

both are classes and implements Wait interface.

WebDriverWait is applied on certain element with defined expected condition and time. This wait is only applied to the specified element. This wait can also throw exception when element is not found.

WebDriverWait wait = new WebDriverWait (driver, 20);
wait.until(ExpectedConditions.VisibilityofElementLocated(By.xpath(""//button[@value='Save Changes']"")));

Fluent wait: Fluent wait is another type of Explicit wait and you can define polling and ignore the exception to continue with script execution in case element is not found.

new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).pollingevery(10, TimeUnit
.SECONDS).ignoring(NoSuchElementException.class);

I am still searching on this topic.


A
Ashish Thakur Replied on 09/07/2019

You can use the below method  for this

WebDriverWait wait = new WebDriverWait(driver, 10).ignoring(NullPointerException)