Appium: Set System Port Through Appium Server CLI

Created on 13 Nov 2017  路  3Comments  路  Source: appium/appium

The problem

Cannot Shard Tests On Android/UIAutomator2

Environment

  • Appium version (or git revision) that exhibits the issue: 1.7.1
  • Node.js version (unless using Appium.app|exe): 7.7
  • Mobile platform/version under test: Native Android/ UIAutomator2
  • Real device or emulator/simulator:Emulator

Details

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.

Question UIAutomator2

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.

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}"

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ckzgraphics picture ckzgraphics  路  3Comments

Hellengo picture Hellengo  路  3Comments

grafoxy picture grafoxy  路  3Comments

hwulfmeyer picture hwulfmeyer  路  3Comments

Nikonovaa picture Nikonovaa  路  3Comments