1

I'm trying to run tests in real iOS devices in parallel using Appium with Selenium Grid. Currently I'm able to create the Hub, instantiate the Nodes and make Appium connected to each respective Node (checked appium_log). My problem right now is that I can't start Appium driver properly. What concerns me the most is that when I start Appium outside Selenium Grid, it runs ok. It seems to be a mismatch between Appium and Selenium Grid Capabilities, but I can't figure out what it is exactly because the error suggests that Appium is trying to load Safari driver instead of iOS driver. Below follows the error and the used configs. Sorry if not all needed information is provided, I'm new in the community, if anything is missing, please let me know so I can edit the post. Thanks in advance.

Error returned

Failure/Error: Unable to find [remote server]
org.openqa.selenium.remote.server.DefaultDriverFactory(DefaultDriverFactory.java) to read failed line
Selenium::WebDriver::Error::UnknownError:
The best matching driver provider org.openqa.selenium.safari.SafariDriver can't create a new driver instance for Capabilities [{app=APP_PATH, noReset=false, newCommandTimeout=60000, browserName=iPhone, deviceName=UDID, version=9.1, launchTimeout=60000, fullReset=false, platform=MAC, autoAcceptAlerts=false}]
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
System info: host: 'MacBook.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.2', java.version: '1.8.0_121'
Driver info: driver.version: unknown (org.openqa.selenium.WebDriverException)

Commands executed before starting appium driver

java -jar sel/selenium-server-standalone-2.53.0.jar -role hub
appium --full-reset -U --tmp tmp-5700/ --nodeconfig sel/node.json > tmp-5700/appium.log

node.json

{
"capabilities":
[{
"browserName": "iPhone",
"version":"9.1",
"maxInstances": 1,
"platform":"mac"
}],
"configuration":
{
"cleanUpCycle":2000,
"timeout":30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://127.0.0.1:5700/wd/hub",
"host": "127.0.0.1",
"port": 5700,
"maxSession": 1,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "127.0.0.1"
}
}

Ruby code used to start Appium Driver (which works without Selenium Grid - just have to remove appium_lib content)

require 'appium_lib'
require 'selenium-webdriver'

opts = {
caps: {
platformName: 'ios',
browserName: 'iPhone',
deviceName: UDID,
platform: 'mac',
version: '9.1',
app: APP_PATH,
launchTimeout: 60000,
newCommandTimeout: 60000,
autoAcceptAlerts: false,
fullReset: false,
noReset: false
},
appium_lib: {
port: 5700,
server_url: "http://127.0.0.1:5700/wd/hub",
wait_timeout: 30
}
}

Appium::Driver.new(opts).start_driver
  • WHAT ARE THE JARS FILES YOU ARE USING ? I THINK YOU MISS SOME FILES – Emna Ayadi Feb 15 '17 at 14:26
  • You are forgetting something crucial here. It's impossible to run >1 IOS simulators on your mac in the same time. Fortunately Facebook came to aid: https://github.com/facebook/FBSimulatorControl only after you manage to run multiple simulators on your mac, then you can start thinking about the selenium grid configrations – David Ep Feb 15 '17 at 15:40
  • Emma: I'm using selenium-server-standalone-2.53.0.jar and appium_lib 8.0.2. – Felyppe Rodrigues Feb 15 '17 at 16:01
  • David: I'm using real mobile devices, not simulators. Also, In this problem I'm trying to instantiate appium in just on device, so this is not a issue here. – Felyppe Rodrigues Feb 15 '17 at 16:01
  • Still stucked with this issue, any news? – Felyppe Rodrigues Feb 17 '17 at 20:51

2 Answers2

0

Problem solved, hope no ones gets stucked with this same issue, but if they do, here is what was wrong. In the capabilities described in ruby used to start appium I was giving the selenium node port instead of appium port.

-1

You have to download the java-client for appium and use the client instead of the selenium server.

Link to java-client jar file > https://mvnrepository.com/artifact/io.appium/java-client/5.0.0-BETA3

M Tofey
  • 11
  • 2
  • the java-client is for java implementation, I'm using ruby. I've downloaded the appium_lib 8.0.2 for ruby and I'm using it. The selenium server jar is used to create the selenium grid and nodes. – Felyppe Rodrigues Feb 20 '17 at 18:10