[英]How to enter Comment in Android app pop up using Appium
我正在使用Appium和Java开发自动化的Android应用程序。 在我的应用程序中,当我单击“完成”按钮时,会弹出一个窗口。 此弹出窗口要求我输入一些文本数据。 然后单击“发送”按钮即可完成任务。
我无法输入评论。
有人可以帮我吗?
这是我正在使用的代码:
public void comment() {
MobileElement EnterComment =
waitForVisibleElementBy(By.xpath("//android.widget.FrameLayout[@resource-id ='com.staffr.app:id/customPanel']" + "/android.widget.EditText"),30);
if (EnterComment != null) {
EnterComment.sendKeys("This is Automation Test");
}
这是帮助您的屏幕截图 :
首先,您必须点击该字段并执行命令
修改后的代码:
public void comment() {
MobileElement EnterComment =
waitForVisibleElementBy(By.xpath("//android.widget.FrameLayout[@resource-id ='com.staffr.app:id/customPanel']" + "/android.widget.EditText"),30);
if (EnterComment != null) {
EnterComment.tap();
EnterComment.sendKeys("This is Automation Test");
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.