TestProject Forum
Powered by leading experts in the test automation community

Wait for activity with appium [on begin and during test]

I started an app that is already installed using Appium.

After the driver is initialized, is it possible to do a wait-until myActivity is displayed or do I have to use a Thread.sleep ?

If you want to wait for a specific activity, you could use the WebDriverWait to verify that an element in that activity has loaded - and then you will know that the activity has successfully loaded.

for example:

WebDriverWait wait = new WebDriverWait(driver, 30);
        .xpath("//android.widget.Button[contains(@text, 'Welcome')]")));