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
Hi,
I am working on fixing a legacy appium automation project (Appium Java client 7.3) where WebElement field is annotated with @WithTimeout annotation like:
public AbstractPage(AppiumDriver driver) {
PageFactory.initElements(new AppiumFieldDecorator(driver) , this);
}
According to the Appium Java client documentation: If time of the waiting for elements differs from usual (longer, or shorter when element is needed only for quick checkings/assertions) then we use the above annotation.
Question 01:
I would like to understand if this waiting time is set implicitly (Appium will ALWAYS wait for 10 seconds for this element to appear) or this timeout is meant for explicit waiting (Appium will wait AT-MAX for 10 seconds)?
Question 02:
Also since i am not passing the Duration or Timeout in the constructor in AppiumFieldDecorator, so will the timeout set in @WithTimeout(time = 10, chronoUnit = ChronoUnit.SECONDS) take effect in this case? or for it to work, we have to pass the Timeout as Duration inside AppiumFieldDecorator?
Question 03:
As far as i understood, passing timeout duratuion in the AppiumFieldConstructor is for setting implicit wait for web elements on the page. If this is the case, I would not want to use it and looking for ways to set explicit waiting on the web elements before I interact with them. Is this possible in PageFactory at all?
Usually I work with By locators and set explicit waiting strategies to find and interact with elements but in this case I am using PageFactory for cross platform application, so i need to find a way to use explicit waits with page factory so Appium should wait for at max of set duration before throwing element not found exception if element is not present or visible on the page.
I will be working on updating it to latest appium java client so I am. making a POC to apply effective waiting strategies in PageFactory. I would really appreciate any inputs and helpful responses. Thank you.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am working on fixing a legacy appium automation project (Appium Java client 7.3) where WebElement field is annotated with
@WithTimeout
annotation like:and the page object is being initiazed as:
According to the Appium Java client documentation:
If time of the waiting for elements differs from usual (longer, or shorter when element is needed only for quick checkings/assertions) then we use the above annotation.
Question 01:
I would like to understand if this waiting time is set implicitly (Appium will
ALWAYS
wait for 10 seconds for this element to appear) or this timeout is meant for explicit waiting (Appium will waitAT-MAX
for 10 seconds)?Question 02:
Also since i am not passing the Duration or Timeout in the constructor in
AppiumFieldDecorator
, so will the timeout set in@WithTimeout(time = 10, chronoUnit = ChronoUnit.SECONDS)
take effect in this case? or for it to work, we have to pass the Timeout as Duration inside AppiumFieldDecorator?Question 03:
As far as i understood, passing timeout duratuion in the AppiumFieldConstructor is for setting implicit wait for web elements on the page. If this is the case, I would not want to use it and looking for ways to set explicit waiting on the web elements before I interact with them. Is this possible in PageFactory at all?
Usually I work with By locators and set explicit waiting strategies to find and interact with elements but in this case I am using PageFactory for cross platform application, so i need to find a way to use explicit waits with page factory so Appium should wait for at max of set duration before throwing element not found exception if element is not present or visible on the page.
I will be working on updating it to latest appium java client so I am. making a POC to apply effective waiting strategies in PageFactory. I would really appreciate any inputs and helpful responses. Thank you.
References:
https://appium.github.io/java-client/io/appium/java_client/pagefactory/AppiumFieldDecorator.html#AppiumFieldDecorator-org.openqa.selenium.SearchContext-java.time.Duration-
https://appium.github.io/java-client/io/appium/java_client/pagefactory/WithTimeout.html
Beta Was this translation helpful? Give feedback.
All reactions