Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Appium. Mobile App Automation. Wait until

Friends, please help!

I don't know how to do "wait.until".

I'm using Appium with UIAutomator.

My test would wait until new app's page will loaded and 'Text 1' in text field will be checked.

I have such parameters in UIAutomator:

text : Text 1;

recource-id: payment_content_title;

class: android.widget.TextView;

package: ru.mts.stm.mobilemts;

IntelliJ says that my code is incorrect:

WebDriverWait wait;
    wait = new WebDriverWait(driver, 60);
    wait.until(ExpectedConditions.textToBe(new MobileBy.ByAndroidUIAutomator(text),"Text 1"));

Thanks

like image 608
Kos Avatar asked Dec 05 '25 14:12

Kos


1 Answers

Use the following code for wait.

 WebDriverWait wait;
    wait.until(ExpectedConditions.presenceOfElementLocated(By.id("put id here")));
like image 158
napendra Avatar answered Dec 07 '25 03:12

napendra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!