Cannot Shard Tests On Android/UIAutomator2
I am using protractor wd/node for writing scenariosand I am looking to shard my tests.
When i try and run 2 tests (1 tests off a Nexus 5 and 1 tests off a Nexus 6) the systemPort is set to 8200 by default on both emulators but I want to have one device to be running off say 8200 and another off 8201.
This can be done on IOS by setting the webdriveragent-port as a command line argument.
But I cannot do this in Android.
A similar issue was raised here https://github.com/appium/appium/issues/7745 but this only works if I specify multiple capabilities with different systemPort numbers. And I dont want the same test to be run off different devices.
I just want to have generic one capability like so
android_emulator: {
deviceName: 'Samsung',
applicationName: 'Samsung',
platformName: 'Android',
platformVersion: '7.1',
browserName: '',
app: 'path_to_app',
automationName: 'UiAutomator2'
},
And set the System Port when creating the 2 appium servers.
there is a possibility to provide capabilities via the command line. Check https://github.com/appium/java-client/issues/763#issuecomment-343887889
Ah I was able to set the system port like so, I was not using java..I am now able to shard the tests.Thank you for the help!
This is what i used, maybe of help to someone.
appium --nodeconfig nodeConfig.json -p 4723 -bp 100 --default-capabilities "{\"udid\":\"emulator-5554\",\"systemPort\":8200}"
appium --nodeconfig nodeConfig2.json -p 4725 -bp 200 --default-capabilities "{\"udid\":\"emulator-5556\",\"systemPort\":8201}"
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Ah I was able to set the system port like so, I was not using java..I am now able to shard the tests.Thank you for the help!
This is what i used, maybe of help to someone.