0
我有Windows 7筆記本電腦連接到兩個Android設備,我試圖運行我的Appium腳本,以便兩個設備安裝應用程序。不知道該怎麼做。 下面是隻有Android設備連接時才能正常運行的代碼。但我的目標是在兩個設備上運行腳本。任何人都可以請幫忙。我開始帶命令提示符的Appium服務器 - 節點appium如何運行Appium連接到Windows筆記本電腦的兩個Android設備
@Test
public void installapp() {
File app = new File("App\\app_US_IT_Ananta.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName","Android Emulator");
capabilities.setCapability("platformVersion", "4.4");
capabilities.setCapability("autoAcceptAlerts", true);
capabilities.setCapability("app", app.getAbsolutePath());
try {
driver1 = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
} catch (MalformedURLException e) {
e.printStackTrace();
}
driver1.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
WebDriverWait wait = new WebDriverWait(driver1, 30);
wait.until(ExpectedConditions.presenceOfElementLocated(By.id("com.android.packageinstaller:id/permission_allow_button")));
driver1.findElement(By.id("com.android.packageinstaller:id/permission_allow_button")).click();
}