I'm trying to run appium scripts on multiple devices in parallel. For that I tried setup appium server(appium v1.6.3) using selenium grid.
Approach I followed: 1. Created Hub.json file
Created nodeconfig json files for two devices
Placed all of them in one folder along with selenium-server-standalone-2.53.0.jar file
In terminal, run the command:
java -jar selenium-server-standalone-2.53.0.jar -role hub -hubConfig /Users/CH0006/Proj_Documentation/Testing/Appium/selenium_config/hub.json
and then run nodeconfig,
node appium --nodeconfig /Users/CH0006/Proj_Documentation/Testing/Appium/selenium_config/iPadmini.json -p 4723
I see below error here:
CH0006s-Mac-mini:lib CH0006$ node appium --nodeconfig /Users/CH0006/Proj_Documentation/Testing/Appium/selenium_config/iPadmini.json -p 4040
/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/appium.js:1
(function (exports, require, module, __filename, __dirname) { import _ from 'loads';
SyntaxError: Unexpected token import
at Object.exports.runInThisContext (vm.js:78:16)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3
Note: Appium.js doesn't exist in bin folder, so that I used path of lib folder where appium.js exists.
Configurations:
Hub.json:
{
"newSessionWaitTimeout" : -1,
"timeout" : 30000,
"capabilityMatcher" : "org.openga.grid.internal.utils.DefaultCapabilityMatcher",
"servlets" : [],
"maxSession" : 5,
"prioritizer" : null,
"host" : null,
"throwOnCapabilityNotPresent" : true,
"nodePolling" : 5000,
"CleanUpCycle" : 5000,
"browserTimeout" : 90000,
"port" : 4444
}
device1.json:
{
"configuration" : {
"registerCycle" : 5000,
"timeout" : 600000,
"maxSession" : 1,
"cleanCycle" : 5000,
"nodeTimeout" : 120,
"hubHost" : "localhost",
"host" : "localhost",
"nodePolling" : 2000,
"hubPort" : 4444,
"role" : "node",
},
"capabilities" : [
{
"platformName" : "iOS",
"version" : "10.1.1",
"maxInstances" : 4,
"deviceName" : "iPad mini",
"browserName" : "iOS",
"platform" : "MAC"
}
]
}
Answer your own questionThanks! :) - Code Rocker