我正在尝试使用 Appium Java 客户端在 testdroid 服务器上自动化我的 android 应用程序测试。在 AndroidElement 上使用 element.sendKeys 时出现无法定位元素的异常。
AndroidElement element = wd.findElement(By.xpath("//android.widget.LinearLayout[1]"
+ "/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]"
+ "/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]"
+ "/android.widget.EditText[1]"));
element.click();
wd.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
element.sendKeys("Hello World");
在上面的代码中 element.sendKeys 抛出异常
找不到元素
看起来它是 sendKey 的“提示文本问题”,但不确定。
请建议我解决方案。