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

  • 1 Replies
  • 1347 Views
Wait for activity with appium [on begin and during test]
« 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 ?

Re: Wait for activity with appium [on begin and during test]
« Reply #1 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')]")));

 

Sitemap 1 2 3 4 5 6 7 8