阿皮移动应用自动化.等到 [英] Appium. Mobile App Automation. Wait until

查看:96
本文介绍了阿皮移动应用自动化.等到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,请帮忙!

我不知道该怎么做"wait.until".

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

我将Appium与UIAutomator一起使用.

I'm using Appium with UIAutomator.

我的测试将等到新应用程序的页面加载完毕并检查文本字段中的文本1".

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

我在UIAutomator中有这样的参数:

I have such parameters in UIAutomator:

text : Text 1;

recource-id: payment_content_title;

class: android.widget.TextView;

package: ru.mts.stm.mobilemts;

IntelliJ说我的代码不正确:

IntelliJ says that my code is incorrect:

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

谢谢

推荐答案

使用以下代码进行等待.

Use the following code for wait.

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

这篇关于阿皮移动应用自动化.等到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆