1

I am running parallel robot framework Appium tests using pabot. Below are my config files:

configDevice1.json

{
    "capabilities":[
      {
      "platformName": "Android",
      "platformVersion": "9.0",
      "browserName": "Android-Huawei-Matepad",
      "deviceName": "Huawei Matepad",
      "udid": "902xxxxxxx",
      "appActivity":"com.app.MainActivity",
      "appPackage":"com.app.preview",
      "noReset":false,
      "automationName":"uiautomator2",
      "groups":"device",
      "maxInstances": 1
      }
    ],
    "configuration":
      {
      "url":"http://127.0.0.1:4724/wd/hub",
      "cleanUpCycle":2500,
      "timeout":30000,
      "maxSession": 1,
      "register": true,
      "registerCycle": 1000,
      "hubPort": 4444,
      "hubHost": "localhost"
      }
  }

configDevice2.json

{
    "capabilities":[
      {
      "platformName": "Android",
      "platformVersion": "9.0",
      "browserName": "Android-Samsung",
      "deviceName": "Android Samsung",
      "udid": "111xxxxxxx",
      "appActivity":"com.app.MainActivity",
      "appPackage":"com.app.preview",
      "noReset":false,
      "automationName":"uiautomator2",
      "groups":"device",
      "maxInstances": 1
      }
    ],
    "configuration":
      {
      "url":"http://127.0.0.1:4724/wd/hub",
      "cleanUpCycle":2500,
      "timeout":30000,
      "maxSession": 1,
      "register": true,
      "registerCycle": 1000,
      "hubPort": 4444,
      "hubHost": "localhost"
      }
  }

I started the two Appium nodes in separate process:

appium --nodeconfig configDevice1.json  -p 4723 -bp 5723
appium --nodeconfig configDevice2.json  -p 4724 -bp 5724

The parallel test works fine if I define the udid on the desired capabilities. However, I am looking for a way to run parallel test without having to specify any udid. For instance, I want to run parallel tests on all devices with platform of Android.

When I run the parallel tests only with capabilities of platformName=Android, all tests run only on one device, conflicting each session from another.

I can see Appium is retrieving connected devices, but then only proceed selecting the first device from that list. This happens in both Appium sessions (Hence making tests failure because it tries to override an existing session)

[debug] [ADB] Connected devices: [{"udid":"111xxxxxxx","state":"device"},{"udid":"902xxxxxxx","state":"device"}]
[AndroidDriver] Using device: 111xxxxxxx

Is there anything one can do to make tests parallel on platform information available on Selenium grid nodes?

Thanks!

Raymond
  • 604
  • 1
  • 9
  • 27

1 Answers1

0

Silly me. The config.json value set should be platform and version. It works well now!

Raymond
  • 604
  • 1
  • 9
  • 27