我正在处理 Appium tutorial,我刚刚设置了我的 SDK。一切都很好,只是我的测试由于 findElementByAccessibilityID 方法而无法编译。当我将鼠标悬停在带有红色灯泡的红色文字上时,它会说,
Cannot resolve method 'findElementByAccessibilityID' in 'AppiumDriver'
编译错误是:
error: cannot find symbol driver.findElementByAccessibilityID("Webview Demo").click();
这是我的测试结果:
@Test
public void testHybridApp() throws InterruptedException {
driver.findElementByAccessibilityID("Webview Demo").click();
Thread.sleep(1000);
driver.context(getWebContext(driver));
driver.get("https://cloudgrey.io");
assert driver.getTitle().equals("Cloud Grey: Appium Delivered");
}