Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FluentWait with max retry Attempts #1628

Closed
apsharma opened this issue Jul 21, 2022 · 1 comment
Closed

FluentWait with max retry Attempts #1628

apsharma opened this issue Jul 21, 2022 · 1 comment

Comments

@apsharma
Copy link

apsharma commented Jul 21, 2022

Looking for suggestions, inputs or pointers on how to build an additional method or configuration for FluentWait that allows specifying maxAttempts(int attempts) ? I realize that I could put this inside a while loop and get the same result but just looking if there was better or alternate way.

I am interested to build something like

 await().atMost(poll_duration.duration, TimeUnit.SECONDS)
                .pollingEvery(poll_interval.interval, TimeUnit.MILLISECONDS)
                .maxAttempts(5)
                .withMessage(" still displayed").
                until(webElement).not().displayed();

Is there value in adding such a capability to FluentWait ?

@filipcynarski
Copy link
Member

I think it is the same like a poolingEvery, but with less controlled cycles. It combines the atMost value divided by polling factor. I think we don't need maxAttempts because it is indirectly implemented as I explained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants