How to “wait to activity” using Appium, on begin and during test itself?

0
0

I’m starting an already installed app using appium.

After my driver is initialized. How do I make it poll-wait till certain activity is displayed?

I saw only this way to wait for activity when starting up

cap.setCapability("app-wait-activity", "activity-to-wait-for");

Is there any other way? How do I wait to another specific activity when not initializing. Say after a button click?

just sleep x seconds ?

  • You must to post comments
0
0

Specific activity means some specific element is being displayed.
I use the following code to wait until some certain element on the screen:

WebDriverWait wait = new WebDriverWait(driver, 30);
wait
.until(ExpectedConditions.elementToBeClickable(By
.xpath("//android.widget.Button[contains(@text, 'Log In')]")));

or:

WebDriverWait wait = new WebDriverWait(driver, 30);
wait
.until(ExpectedConditions.presenceOfElementLocated(By
.xpath("//android.widget.TextView[contains(@resource-id, 'action_bar_title')]")));
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website