运行Selenium时参数不正确?

时间:2017-04-04 08:11:46

标签: eclipse macos selenium appium-ios

我正在使用真正的ios设备在Mac上测试我的应用。当我运行脚本时,它表示在Eclipse IDE中出现以下错误,

  

org.openqa.selenium.SessionNotCreatedException:无法创建新的   远程会话。期望的能力=能力   [{应用= /用户//下载/ XXX.ipa,
  platformVersion = 10.2.1,platformName = iOS,deviceName = Mr.x' S iPod touch,   UDID = *****}],必需的能力=   能力[{}]

然后我检查了它显示的appium中的日志,

  

[debug] [MJSONWP]错误的参数:BadParametersError:参数是   不正确。我们想要{" required":[" desiredCapabilities"]," optional":   [" requiredCapabilities"," sessionId"," id"]}并且您发送了[   " desiredCapabilities" ," requiredCapabilities"," capabilities",   " alwaysMatch"" firstMatch"]

我该怎么做才能解决这个问题,任何人都可以帮我解决这个问题。

1 个答案:

答案 0 :(得分:-1)

是的,您需要使用xcode才能访问iOS本机应用程序。

要使用的所需功能:

    DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("platformName", "iOS");
        capabilities.setCapability("platformVersion", "9.3");
        capabilities.setCapability("deviceOrientation", "portrait");
        capabilities.setCapability("browserName", "Safari");
        capabilities.setCapability("autoWebview", "true");
        capabilities.setCapability("automationName", "XCUITest");
        capabilities.setCapability("deviceName", "iphone");
        capabilities.setCapability("autoAcceptAlerts",true);
        capabilities.setCapability("udid", UDID);
        capabilities.setCapability("xcodeConfigFile", "/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Config.xcconfig");
        capabilities.setCapability("realDeviceLogger","/usr/local/lib/node_modules/deviceconsole");