Selenium Grid trying to assign Android to Windows machine

All nodes are registered correctly on the selenium grid, but somehow Android tests are trying to run on the firefox node. Help?

Here is the basic info for each node:

mac1:
browserName: iPhone
version: 9.0
platform: MAC

mac2:
port: 4725
browserName: Android
version: 9.0
platform: ANDROID

mac2:
port: 4723
browserName: iPhone
version: 9.0
platform: MAC

windows:
port: 5555
browserName: firefox
platform: WINDOWS

How are you setting up your desired capabilities object? Paste the code you use to build the object.

desired caps for the node, hub, or the android test?

Just the capabilities for the Android test should be good enough, but having all 3 sets of capability configurations shown would be helpful too.

for the android test my caps are:

platformName = “Android”
platformVersion = “4.4.2”
deviceName = “Galaxy S4”

Should I include “platform”? How does platformName and platform differ?

I’ve already essentially given the node capabilities above. Each uses a json config file. I noticed that the Android test is trying to run on the IOS nodes, also.

here’s a log from the hub console:

INFO: REQUEST : {app=[redacted], platformVersion=4.4.2, platformName=Android, deviceName=Galaxy S4}
Apr 20, 2016 4:46:05 PM hudson.plugins.selenium.JenkinsCapabilityMatcher matches
INFO: CURRENT : {browserName=iPhone, maxInstances=1, version=9.0, platform=MAC}
Apr 20, 2016 4:46:05 PM hudson.plugins.selenium.JenkinsCapabilityMatcher matches
INFO: REQUEST : {app=[redacted], platformVersion=4.4.2, platformName=Android, deviceName=Galaxy S4}
Apr 20, 2016 4:46:05 PM org.openqa.grid.internal.TestSlot getNewSession
INFO: Trying to create a new session on test slot {browserName=iPhone, maxInstances=1, version=9.0, platform=MAC}

looking at these logs, i think it might be a problem with “hudson.plugins.selenium.JenkinsCapabilityMatcher”

My real issue was not including browserName in my tests’ capabilities. I wasn’t sure if it was required and contradicts some other documentation that says “app” and “browserName” are incompatible. However, when using grid, browserName is required to match with the proper node. After implementing that, I was getting an unrelated error found here:

https://github.com/appium/appium/issues/6412.

The issue lists several workarounds. I’ve opted to downgrade to Appium1.4.16 and it works fine.

Summary:

  • Include browserName capability in test and node (they need to match!)
  • If on Appium 1.5, use a workaround, or downgrade to Appium 1.4.16

Ah, that certainly is quite interesting. I use the Selenium standalone package, which uses the DefaultCapabilityMatcher by default. This matcher uses browserName as a criterion for matching, but only if it is present in the capabilities request; since my tests don’t specify browserName, I have not yet run into issues where browserName’s value matters.

Yeah, I think it’s possible to match only on platform and version , but it wasn’t working for me.