Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Explicit wait: timeout is not as expected when implicit_timeout < explicit_timeout #7972

Closed
lukeis opened this issue Mar 4, 2016 · 4 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 7972

# What steps will reproduce the problem?
1. new WebDriver (chrome/firefox)
2. set implicit wait to X
3. driver.get("google.com")
4. explicitly wait until the element "#asd" (that is not present) is visible (timeout
= Y)

Examples:
| explicit_timeout (Y) | implicit_timeout (X)  | actual_timeout |
|27 | 27 | 27 |
|16 | 52 | 51 |
| 52 | 16 | 65| <-- weird
|12 | 4 | 13 |
|61 | 29| 88 | <-- weird

Same values with chrome as well as with FF.

Turns out that:
1. if implicit_timeout = explicit_timeout => actual_timeout = implicit_timeout = explicit_timeout
2. if implicit_timeout > explicit_timeout => actual_timeout = implicit_timeout
3. if implicit_timeout < explicit_timeout => ???

Comments:
1. nothing new
2. not what I expected (actual_timeout = explicit_timeout), but may be reasonable.
Provided this is working as designed, I think it needs to be rewritten down somewhere
(at least in the javadoc of FluentWait), as AFAIK it is not documented anywhere.
3. this is weird, I think. I can't figure out how 65 and 88 are calculated. It's less
than the sum of explicit + implicit.


# Env Info
Selenium version: 2.43.1
OS: MacOSX 10.9.5
Browser: Google Chrome 37.0.2062.124
Browser: Firefox 32.0.3


# Sample:
http://git.io/zJeh-g

Reported by scotto.alberto.86 on 2014-09-29 18:26:28

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by barancev on 2014-09-29 19:01:25

  • Labels added: Component-Docs

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

This issue was closed by revision af9e4e6217a5.

Reported by luke.semerau on 2014-10-11 04:11:20

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

your 'weird' state is actually expected if you look at how both mechanisms work. The
recommendation is and always will be to not use both types of waits at the same time.

in the timeout situation of both, if the implicit wait is shorter than the explicit
wait, then the implicit condition will be tried until the explicit timeout has been
elapsed. To guess how long the timeout will be, add the implicit wait timeout to itself
until the total exceeds the explicit wait (example implicit: 5, explicit: 16, timeout
should be about 20seconds) There's always potentially more time because of processing
time of the command.

Reported by luke.semerau on 2014-10-11 04:17:25

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:24:37

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 4, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant