0

我单击 appium.exe UI 中的启动按钮而不对其进行配置。当我运行以下代码时,我的 android 模拟器中没有首选项。如何在带有 appium 的 android 模拟器中启动 chrome 浏览器。

//setup the web driver and launch the webview app.
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("app", "chrome");
desiredCapabilities.setCapability("device", "Android");
URL url = null;
try {
url = new URL("http://localhost:4723/wd/hub");
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
RemoteWebDriver remoteWebDriver = new RemoteWebDriver(url, desiredCapabilities);

// Navigate to the page and interact with the elements on the guinea-pig page using id.
remoteWebDriver.get("http://saucelabs.com/test/guinea-pig");
WebElement div = remoteWebDriver.findElement(By.id("i_am_an_id"));
Assert.assertEquals("I am a div", div.getText()); 
//check the text retrieved matches expected value
remoteWebDriver.findElement(By.id("comments")).sendKeys("My comment"); 
//populate the comments field by id.

//close the app.
remoteWebDriver.quit();
4

1 回答 1

1

SauceLab 的 Android 模拟器上未安装 Chrome,因此您将无法启动 chrome。最重要的是,Appium 不支持通过 saucelabs 进行 Web 测试。

于 2014-06-03T14:18:07.723 回答