Appium's implicitlyWait does not work Appium's implicitlyWait does not work selenium selenium

Appium's implicitlyWait does not work


The code you have posted manages the timeout to wait for a maximum of 50 seconds. It doesn't make the driver wait 50 seconds. You can use the wait like:

 driver.wait(); //this will wait a max of 50 seconds cuz you said so

If you ask me the proper way you would want to use waiting on Webdriver is:

WebDriverWait wait;wait = new WebDriverWait(driver, 60);wait.until(ExpectedConditions.elementToBeClickable(By.id("blabla"));

The code above checks if blabla is clickable until that condition is proved or 60 seconds(stated above) passes the driver waits.


In Appium it is possible to set implicit way in this way:

Java code:

AppiumFieldDecorator decorator = new AppiumFieldDecorator(driver);decorator.resetImplicitlyWaitTimeOut(50, TimeUnit.SECONDS);PageFactory.initElements(decorator, this /* refers to current page object class*/);

Such timeout will work for the whole time.

It is not possible (at least I don't know) to change it.

As when web drivers are used you can do this with:

driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);// some actions for which you don't want to wait implicitlydriver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);


Try this:

public static void WaitForElementPresent1(String locator, int timeout){    WebDriverWait wait = new WebDriverWait(driver, timeout);    try{           wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locator)));    } catch (Exception e){        e.printStackTrace();    } }