appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Apache License 2.0
1.18k stars 752 forks source link

Incorporate Poll Delay in Appium Fluent Wait #2111

Closed AlessandroMiccoli closed 4 months ago

AlessandroMiccoli commented 5 months ago

Description

I need a poll delay before starting to look for an element. At the moment, I didn't find this feature inAppiumFluentWait.

Environment

Current Solution

When I need a poll delay, I use the library awaitility, which provides this feature and others. Or I find an alternative solution using TimeUnit#sleep.

Code

I would like to have something like this:

AppiumFluentWait<>(this.driver).pollDelay(pollDelay). etc...

Questions:

  1. Is there a reason for this missing feature?
  2. What is the right way to do it, even with the last version of the appium java-client library?
  3. If there isn't a solution with the library, is it something you are interested in having it? Probably, I could find some time to integrate it.
valfirst commented 5 months ago

@AlessandroMiccoli please feel free to create PR

AlessandroMiccoli commented 4 months ago

@valfirst I created the PR 2116

I see a lot of new features we could implement (i.e. setDefaultValues), but probably the best place is directly in Selenium method FluentWait. What do you think?

I just implemented the pollDelay, so I was not out of scope.