MoNa
MoNa

Reputation: 471

Error forwarding the new session cannot find : Capabilities [{iPhone=Safari, browserName=Safari, deviceVersion=10.3.1, platformName=iOS}]

I m trying to launch Safari Browser in Mobile using Appium on Mac.

Below are the capabilities I have used in eclipse

desCapabilities = DesiredCapabilities.iphone();
desCapabilities.setCapability(BrowserType.IPHONE, "Safari");
desCapabilities.setCapability("browserName", "Safari");
desCapabilities.setCapability("platformName","iOS");
desCapabilities.setCapability("deviceName", "iPhone");
desCapabilities.setCapability("version", "10.3.1");
desCapabilities.setCapability("udid", "mobileID");
driver = new RemoteWebDriver(new URL("http://" + nodeUrl + ":" + nodeUrlPort + "/wd/hub"), desCapabilities);

When I try to run in eclipse, below are the exception I m facing.

org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find : Capabilities [{iPhone=Safari, browserName=Safari, platformName=iOS, udid=****, deviceName=Ananda's iPhone, version=10.3.1, platform=MAC}]
Command duration or timeout: 233 milliseconds
Build info: version: '2.53.1', revision: '*****', time: '2016-06-30 19:26:09'
System info: host: 'hostname', ip: 'ipaddress', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.4', java.version: '1.7.0_71'
Driver info: org.openqa.selenium.remote.RemoteWebDriver 

Kindly help me out in this.

Upvotes: 2

Views: 1212

Answers (2)

Padma
Padma

Reputation: 117

To fix the issues in desired capabilities, change your code for desired capabilities as

desCapabilities.setCapability("browserName", "Safari");
desCapabilities.setCapability("platformName","iOS");
desCapabilities.setCapability("deviceName", "write the name of the test device (eg: myphone)");
desCapabilities.setCapability(“platformVersion”, "10.3.1");
desCapabilities.setCapability("udid", "write the mobile udid");

There is a difference between version and platform version.

platform Version is the mobile operating system version that you want to use in your test. Version is the version of the browser you want to use in your test.

You can refer DesiredCapabilities [here][1].

[1]: a) https://wiki.saucelabs.com/display/DOCS/Desired+Capabilities+Required+for+Selenium+and+Appium+Tests b) https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities

Upvotes: 1

Abhinav
Abhinav

Reputation: 1027

You need to use appium 1.6.4 for ios 10.3.1. Upgrade your environment and it will sort out the issue. Refer to below link:

github.com/appium/appium/releases/tag/v1.6.4

Appium 1.6.4 fixes numerous issues with the previous releases. This release supports iOS 10.3 as well as Android 7.1.

And for ios 10 and onwards you have to use appium 1.6.x and ios 10.3 support has been provided in appium 1.6.4

Upvotes: 0

Related Questions