0

構成せずに appium.exe UI の起動ボタンをクリックします。次のコードを実行すると、Android エミュレーターに設定がありません。

//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 を起動することはできません。その上、Web テストは、ソースラボによる Appium ではサポートされていません。

于 2014-06-03T14:18:07.723 に答える