How to control time in appium when find element

There are implicit and explicit waits. Explicit waits allow you to define maximum wait time and as the condition (e.g., visibility of element) is met the wait will stop and next statement will be executed.

Here is the sample method in java:

public void waitForScreenToLoad(AppiumDriver lDriver, WebElement element, int seconds){

          WebDriverWait wait = new WebDriverWait(lDriver,seconds);
          wait.until(ExpectedConditions.visibilityOf(element));

}

5 Likes