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

page object pattern, field with "@WithTimeout" would change the global implicit wait time #467

Closed
truebit opened this issue Sep 9, 2016 · 2 comments · Fixed by #468
Closed
Labels

Comments

@truebit
Copy link
Contributor

truebit commented Sep 9, 2016

Description

page object pattern, field with "@WithTimeout" would change the global implicit wait time

Environment

Always exists. see code analysis below

Details

in method AppiumElementLocatorFactory#createLocator:

  • if the page object field contains annoation WithTimeout, it would create a new TimeOutDuration instance.
  • This instance would be passed to AppiumElementLocator.
  • When element tries to find the element. It would invoke method AppiumElementLocator#waitFor. See the line in finally block. it would change the global implicit wait time using the WithTimeout value.

So this would make the page object and global appium driver implicit wait both change to that value. It would mess the implicit timeout when there are many WithTimeout elements in page objects that contains driver.findElement methods.

There is no getter for implicit wait by design. so it is not easy to fix this.

Solution suggestion:
IMO changing constructors that also passes original timeout duration as argument, in finally block it would set back to original timeout duration.

@truebit
Copy link
Contributor Author

truebit commented Sep 9, 2016

I created a PR to fix this issue

@TikhomirovSergey
Copy link
Contributor

@truebit Yes. You are right. Thanks for the catching.

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

Successfully merging a pull request may close this issue.

2 participants