【发布时间】:2017-11-29 05:46:37
【问题描述】:
我是使用带有 TestNG 的 Appium 测试的移动应用自动化的新手。我正在练习自动化亚马逊应用,应用成功启动,但是当我尝试点击登录选项时,它得到:
“失败:登录 org.openqa.selenium.NoSuchElementException: An 使用给定搜索无法在页面上找到元素 参数。 (警告:服务器没有提供任何堆栈跟踪 信息)命令持续时间或超时:0毫秒”
public void login() throws InterruptedException{
System.out.println("Login check");
Thread.sleep(3000);
// String sample = driver.findElementByXPath("//*[@class='android.widget.Button' and @index='5']").getText();
System.out.println("Next sleep");
// driver.findElement(By.xpath("//[@class='android.widget.Button' and @index='5']')]")).click();
// driver.findElement(By.id("in.amazon.mShop.android.shopping:id/sign_in_button")).click();
driver.findElement(By.xpath("//android.widget.Button[@index='5']")).click();
Thread.sleep(3000);
System.out.println("Pass");
}
【问题讨论】:
标签: android selenium appium-android