我正在尝试在终端窗口中设置一些 appium 所需功能,以便我可以针对不同的模拟器设备运行我的测试:
Terminal: $ appium --device-name 'iPhone 6'
但是,我必须在实际代码中设置所需的功能,因此我有一个有效的 IOSDriver 实例。我使用这段代码:
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("platformVersion", "8.3");
capabilities.setCapability("app","../Build/Products/Debug-iphonesimulator/LightAlarm.app");
driver = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"),capabilities);
当我运行测试时,我收到一个错误,即没有设置deviceName:
The following desired capabilities are required, but were not provided: deviceName
但是,我的终端 appium 服务器设置正确:
info:欢迎使用Appium v1.4.0(REV dc30dae9e8fe8c85eeea707dbdbd60350fdff55b) info:Appium REST http接口监听器在0.0.0.0:4723上启动 info:[debug]非默认服务器args:{" deviceName":" iPhone 6"} info:Console LogLevel:debug
任何想法可能出错?