You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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:
WithTimeout
, it would create a newTimeOutDuration
instance.AppiumElementLocator
.finally
block. it would change the global implicit wait time using theWithTimeout
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 containsdriver.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.
The text was updated successfully, but these errors were encountered: