阿皮姆.移动应用自动化.等到



朋友们,请帮忙!

我不知道如何做"等待"。

我正在使用带有UIAutomator的Appium。

我的测试会等到新应用程序的页面加载并且文本字段中的"文本 1"将被选中。

我在UIAutomator中有这样的参数:

text : Text 1;
recource-id: payment_content_title;
class: android.widget.TextView;
package: ru.mts.stm.mobilemts;

IntelliJ说我的代码不正确:

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

谢谢

使用以下代码进行等待。

WebDriverWait wait;
wait.until(ExpectedConditions.presenceOfElementLocated(By.id("put id here")));

嗨,您可以使用以下方法:

public MobileElement waitForElement(AppiumDriver<?> appiumDriver, MobileElement element) {
webDriverWait = new WebDriverWait(appiumDriver, 15);
webDriverWait.until(ExpectedConditions.elementToBeClickable(element));
return element;
}

最新更新