我正在尝试在iOS Simulator中运行移动Web appium脚本。我在代码中使用了以下Desired功能。
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("platformName", "iOS");
caps.setCapability(CapabilityType.BROWSER_NAME, "safari");
caps.setCapability("platformVersion", "10.3");
caps.setCapability("deviceName", "iPhone 7");
caps.setCapability("automationName", "XCUITest");
try {
driver =new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),caps);
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
driver.get("https://shopping.google.com");
但是我得到的是黑屏,上面写着“ Let's browser”,执行被卡住,直到我终止会话。有什么想法吗?如何解决
我已将模拟器版本更新为12.2,并在所需功能中提到了正确的名称,这解决了我的问题
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("platformName", "iOS");
caps.setCapability(CapabilityType.BROWSER_NAME, "safari");
caps.setCapability("platformVersion", "12.2");
caps.setCapability("deviceName", "iPhone 8 Plus");
caps.setCapability("automationName", "XCUITest");
try {
driver =new RemoteWebDriver(new URL(prop.getProperty("AppiumurlPort")),caps);
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}