如何使用Appium在Android应用弹出窗口中输入注释

如何使用Appium在Android应用弹出窗口中输入注释,android,popup,comments,appium,Android,Popup,Comments,Appium,我正在使用Appium和Java开发一个自动化Android应用程序。在我的应用程序中,当我单击“完成”按钮时,会弹出一个窗口。此弹出窗口要求我输入一些文本数据。然后单击send按钮完成任务 我无法输入评论 有人能帮我吗 以下是我正在使用的代码: public void comment() { MobileElement EnterComment = waitForVisibleElementBy(By.xpath("//android.widge

我正在使用Appium和Java开发一个自动化Android应用程序。在我的应用程序中,当我单击“完成”按钮时,会弹出一个窗口。此弹出窗口要求我输入一些文本数据。然后单击send按钮完成任务

我无法输入评论

有人能帮我吗

以下是我正在使用的代码:

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");
    }

请告诉我执行sendkey命令时的错误。