Created
September 8, 2020 10:59
-
-
Save ShamaUgale/cce2da71e0eca5e4240dc88009a2018a to your computer and use it in GitHub Desktop.
This is a demonstration of applying FluentWait in selenium 4 vs 3.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.TimeUnit; // Selenium 3 | |
import java.time.Duration; // Selenium 4 | |
// selenium 3 usage | |
FluentWait wait = new FluentWait(driver) | |
.pollingEvery(20, TimeUnit.MILLISECONDS) | |
.withTimeout(20, TimeUnit.SECONDS) | |
.ignoring(NoSuchElementException.class); | |
//selenium 4 usage | |
FluentWait wait = new FluentWait(driver) | |
.pollingEvery(Duration.ofMillis(500)) | |
.ignoring(NoSuchElementException.class) | |
.withTimeout(Duration.ofSeconds(60)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment