We would like to run our existing Appium tests in parallel using Selenium Grid.
Env: macOS, stand-alone selenium server:3.141.59, appium: 1.17.1. I have 2 android devices connected.
Error message in selenium grid server log:
/wd/hub/session java.io.IOException: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {
{
"desiredCapabilities": {
"app": "\u002fUsers\u002fhome\u002fsrc\u002fmobile-android\u002fapp\u002fbuild\u002foutputs\u002fapk\u002fvanilla\u002fdebug\u002fvanilla-local-debug-DEV.apk",
"appPackage": "com.example.android.apps.connectmobile",
"disableWindowAnimation": true,
"noReset": true,
"noSign": true,
"appWaitActivity": "com.example.android.apps.connectmobile.myday.AnActivity",
"deviceName": "wenda",
"fullReset": false,
"appWaitDuration": 5000,
"skipUninstall": true,
"newCommandTimeout": 180,
"platformVersion": "9",
"automationName": "UiAutomator2",
"platformName": "Android",
"udid": "520032834252c58d",
"printPageSourceOnFindFailure": true
},
"capabilities": {
"firstMatch": [
{
"appium:app": "\u002fUsers\u002fhome\u002fsrc\u002fmobile-android\u002fapp\u002fbuild\u002foutputs\u002fapk\u002fvanilla\u002fdebug\u002fvanilla-local-debug-DEV.apk",
"appium:appPackage": "com.example.android.apps.connectmobile",
"appium:appWaitActivity": "com.example.android.apps.connectmobile.myday.AnActivity",
"appium:appWaitDuration": 5000,
"appium:automationName": "UiAutomator2",
"appium:deviceName": "wenda",
"appium:disableWindowAnimation": true,
"appium:fullReset": false,
"appium:newCommandTimeout": 180,
"appium:noReset": true,
"appium:noSign": true,
"platformName": "android",
"appium:platformVersion": "9",
"printPageSourceOnFindFailure": true,
"skipUninstall": true,
"appium:udid": "520032834252c58d"
}
]
}
}
We are using JUnit to execute the tests and create an AndroidDriver with the DesiredCapabilities above.
val appiumServerUrl = URL("http://localhost:4444/wd/hub")
val androidDriver = AndroidDriver<MobileElement>(appiumServerUrl, capabilities)
We have a selenium server grid node and 2 appium nodes running in 3 different terminal windows
java -jar selenium-server-standalone-3.141.59.jar -role hub
appium -p 4723 --nodeconfig nodeconfig-wenda.json
appium -p 4733 --nodeconfig nodeconfig-piggie.json
The nodeconfig-wenda.json file should match the DesiredCapabilities
{
"capabilities":
[
{
"app": "/Users/home/src/mobile-android/app/build/outputs/apk/vanilla/debug/vanilla-local-debug-DEV.apk",
"appPackage": "com.example.android.apps.connectmobile",
"disableWindowAnimation": true,
"noReset": true,
"noSign": true,
"appWaitActivity": "com.example.android.apps.connectmobile.myday.AnActivity",
"deviceName": "wenda",
"fullReset": false,
"appWaitDuration": 5000,
"skipUninstall": true,
"newCommandTimeout": 180,
"platformVersion": "9",
"automationName": "UiAutomator2",
"platformName": "Android",
"udid": "520032834252c58d",
"printPageSourceOnFindFailure": true
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 1,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "127.0.0.1",
"hubProtocol": "http"
}
}
The error message "Cannot extract a capabilities from the request" isn't helping understand the issue. There are other questions out there on the internet trying to solve this kind of issue but they have not helped me. Hopefully, someone has some suggestions.