我在MAC机上运行appium,同时也在Android和iOS上工作。我定义了Android所需的功能正常工作并能够启动网站。但是,当我尝试使用相同的iPhone功能时,它会显示给我
"[POST /wd/hub/session {"desiredCapabilities":{"platform":"MAC","platformVersion":"9.1","platformName":"iOS","deviceName":"iPhone 6 Plus","browserName":"Chrome","version":""}}]
info: <-- POST /wd/hub/session 500 14.772 ms - 564
TypeError: Cannot set property 'onResetTimeout' of null"
我声明的所需功能是:
as:DeviceCapabilities [{platform=MAC, platformVersion=9.1, deviceName=iPhone 6 Plus, browserName=Chrome, version=}]
我已经为它更新了Xcode,但似乎没有什么工作正常。
答案 0 :(得分:0)
您设置的功能需要更改
platform=MAC
到platform=iOS
和browserName=Chrome
不是必需的,version
在您的代码中似乎无效。
最小所需功能的相应Java代码(我试图在示例中引用您的详细信息)是:
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.1");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.IOS);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6 Plus");
capabilities.setCapability(MobileCapabilityType.APP,<app path>);
答案 1 :(得分:0)
DesiredCapabilities IOSCapability=new DesiredCapabilities();
IOSCapability.setCapability("platformName", "iOS");
IOSCapability.setCapability("platformVersion", OSVERSION);
IOSCapability.setCapability("deviceName", DEVICENAME);
IOSCapability.setCapability("app", APPPATH);
//if you are using real device
IOSCapability.setCapability("udid", UDID);