Parallel Test With Appium & Selenium Grid
Solution 1:
The problem is because neither have you provided anything that is unique in your DesiredCapabilities nor have you added a custom CapabilityMatcher. By default the Grid uses only the browserName, version and platform to decide which node a test is to be routed to.
Here's one way of fixing the problem. Add a new key named "applicationName" to your nodeConfig.json and set the values of "OnePlusOne" and "SamsungS6" respectively. You then add a new capability named "applicationName" to your desired capability in your test and then set the value of "OnePlusOne" and "SamsungS6" respectively. After this your test would be routed to the correct device.
You can read more about this in my blog post here.
Solution 2:
i also faced the same issue but got resolved by
Step1: add the appium (.. \Appium\node_modules.bin) in you environment variable Step2: make the differen json for the each node.
for node 1
{"capabilities":[{"version":"6.0","maxInstances":1,"platform":"ANDROID","newCommandTimeout":"30","deviceReadyTimeout":5}],"configuration":{"cleanUpCycle":2000,"timeout":10800,"url":"http://127.0.0.1:4723/wd/hub","host":"127.0.0.1","port":4723,"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","maxSession":1,"register":true,"registerCycle":5000,"hubPort":4444,"hubHost":"127.0.0.1"}}
for node 2
{"capabilities":[{"version":"5.0.2","maxInstances":1,"platform":"ANDROID","newCommandTimeout":"30","deviceReadyTimeout":5}],"configuration":{"cleanUpCycle":2000,"timeout":10800,"url":"http://127.0.0.1:4733/wd/hub","host":"127.0.0.1","port":4733,"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","maxSession":1,"register":true,"registerCycle":5000,"hubPort":4444,"hubHost":"127.0.0.1"}}
now for to run the hub i have made that in a batch file
java -jar %cd%\selenium-server-standalone-2.52.0.jar -role hub http://127.0.0.1:4444/grid/console
and
for node1
appium -a127.0.0.1 -p4723--no-reset--bootstrap-port4728 -U 192.168.56.101:5555 --nodeconfig %cd%\5555appium1.json
and node 2
appium -a127.0.0.1 -p4733--no-reset--bootstrap-port4738 -U 4d00af03525c80a1 --nodeconfig %cd%\4d00appium2.json
and in you code add the deviceName:'your device name which comes on adb devices in cmd'
This really worked for me.
Post a Comment for "Parallel Test With Appium & Selenium Grid"