Questions tagged [fluentwait]

FluentWait

FluentWait is one of the implementation of the Selenium's Wait interface through which user can confugre custom/tailor-made timeouts and polling intervals runtime.

Through FluentWait instance users can define the maximum amount of time to wait for a condition through a custom frequency to check the condition. The user can also configure the wait instance to ignore specific exceptions while waiting such as NoSuchElementExceptions when searching for an element on the page.

Sample Usage

// Waiting 30 seconds for an element to be present on the page, checking
// for its presence once every 5 seconds.
Wait<WebDriver> wait = new FluentWait<WebDriver>(driver)
    .withTimeout(Duration.ofSeconds(100))
    .pollingEvery(Duration.ofMillis(600))
    .ignoring(NoSuchElementException.class);

WebElement foo = wait.until(new Function<WebDriver, WebElement>() {
    public WebElement apply(WebDriver driver) {
        return driver.findElement(By.name("q"));
    }
});

Reference

Class FluentWait

29 questions
0
votes
0 answers

Synchronisation issue in handling dynamic webtable

I have a simple webtable called branch which has columns id, branchName, BranchLocaction. Ihave to scenarios to add one branch and test if it is correctly added or not. I have the below function which is supposed to give me the latest id before…
0
votes
3 answers

the method withtimeout(duration) in the type fluentwait is not applicable for the arguments (int, timeunit)

An error appear while working with this code the error is "The method withTimeout(Duration) in the type FluentWait is not applicable for the arguments (int, TimeUnit)" Wait wait = new FluentWait(driver) .withTimeout(30, SECONDS) …
0
votes
2 answers

Fluent Wait in selenium with custom condition - chrom

I have an issue that I am facing, I want to create a function that waits until the text "Other" exists in List. I want it to wait 30 seconds, and in every 5 seconds it will do the call again and validate the new list. (Maximum 5 - 6 times to…
Bastian
  • 1,089
  • 7
  • 25
  • 74
0
votes
1 answer

When is the first call in pollingEvery() method?

I'm working on Selenium now and I have to use FluentWait. There's a line in my code which led me straight here. .pollingEvery(Duration.ofMillis(250)) When is the first call? Is it at the moment I run the code or after 250 millis? I've been…
Lucy
  • 3
  • 2
0
votes
1 answer

Do we need to give less time declared for ExplicitWait compared to Implicitwait

Somewhere I read that mixing Implicit and Explicit gives unprecitable result. Is it true? Source: https://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#advanceduserinteractions WARNING: Do not mix implicit and explicit waits! Doing so can cause…
0
votes
1 answer

The type Function is not generic; it cannot be parameterized with arguments

Wait wait = new FluentWait(driver) .withTimeout(Duration.ofSeconds(30)) .pollingEvery(Duration.ofMillis(500)) .ignoring(NoSuchElementException.class); WebElement foo = wait.until(new Function
0
votes
3 answers

Need help on wait Timeout

I am currently doing a small project on web automation. Its for online betting at live roulette lounges, my problem is this, since these are live-streamed events they have controls in place that show you things on screen and also control when and…
0
votes
1 answer

How does FluentWait in Selenium implements the until() method

The syntax of the until() method in selenium docs is as below: public V until(java.util.function.Function isTrue) The usage of the same is like: WebDriver wait = new WebDriver(driver, 20); WebElement loginButton =…
learningQA
  • 641
  • 1
  • 5
  • 20
0
votes
3 answers

I am trying to convert Java code to scala

I want to use fluent wait with selenium in scala. However I am not able to convert the below code into Scala. Please help me out. Wait wait = new FluentWait(driver) .withTimeout(30, SECONDS) .pollingEvery(5,…
Anand Nautiyal
  • 245
  • 2
  • 5
  • 11
-1
votes
1 answer

Need help understanding the fluent wait Java code

I am trying to understand the Java code associated with fluent Wait in Selenium. The code goes as below: WebElement foo = wait.until(new Function() { public WebElement apply(WebDriver driver) { return…
MitSM
  • 21
  • 11
-1
votes
3 answers

How do I perform a static wait in selenium using java?

It's pretty frustrating. Everywhere I look people keep telling me to use explicit, implicit, and fluent waits. These waits make it so you pause based on elements. However, patronizing us and removing tools and options is not a good idea. In my…
sergiy
  • 161
  • 1
  • 2
  • 11
-1
votes
1 answer

Selenium WebDriver (JAVA) - Fluent wait seems not to be working HALP

After some time searching for the issue I have I could not encounter any solution. So here I am. Some background, I am trying to automate the sign up, confirmation and join for a "Live Class" for certain platform. To do so, you have every 10 minutes…
-2
votes
1 answer

org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element with using FluentWait

I change from WebDriverWait to FluentWait because it was deprecated and now I'm getting an error private val waitForElement = FluentWait(DriverFactory.driver).withTimeout(Duration.ofMinutes(1)).pollingEvery(Duration.ofSeconds(1)) @Step("Choose…
Dev
  • 11
  • 3
-3
votes
2 answers

How to validate if an element is enabled only after 60 seconds

I have a link in my application which gets enabled after 60 seconds. I have to verify , that the link only gets enabled after 60 seconds not before that. Have tried below ways: I have tried element to be clickable() with fluent wait/webdriver…
1
2