O'Reilly logo

Mobile Test Automation with Appium by Nishant Verma

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Explicit wait

There are times when the app under test can be slow on certain specific elements, such as page submit, form submit, or somewhere it fetches data from an external system and takes a little more time to load. In that case, using implicit wait to handle the situation will be a flawed approach, given that it has to wait for each and every element for the same specified time.

To handle this situation, we can use explicit wait for such elements. In explicit wait, we tell the web driver instance to wait for a certain condition invoked through ExpectedConditions. So, this wait applies explicitly to the specified element. Explicit wait can be invoked using this code:

WebDriverWait wait = new WebDriverWait(appiumDriver, 10);wait.until( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required