TestProject Forum

General => Appium => Topic started by: Sebastian on May 02, 2016, 17:08:47 pm

Title: Wait for activity with appium [on begin and during test]
Post by: Sebastian on May 02, 2016, 17:08:47 pm
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 ?
Title: Re: Wait for activity with appium [on begin and during test]
Post by: Johnny_b on August 29, 2016, 10:34:24 am
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:
Code
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.elementToBeClickable(By
        .xpath("//android.widget.Button[contains(@text, 'Welcome')]")));