使用Selenium网格的Appium导致-GridException:无法从请求中提取功能
我们希望使用Selenium网格并行运行现有的Appium测试 Env:macOS,独立的selenium服务器:3.141.59,appium:1.17.1。我连接了两台android设备 selenium网格服务器日志中的错误消息:使用Selenium网格的Appium导致-GridException:无法从请求中提取功能,appium,selenium-grid,selenium-grid2,Appium,Selenium Grid,Selenium Grid2,我们希望使用Selenium网格并行运行现有的Appium测试 Env:macOS,独立的selenium服务器:3.141.59,appium:1.17.1。我连接了两台android设备 selenium网格服务器日志中的错误消息: /wd/hub/session java.io.IOException: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request
/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"
}
]
}
}
我们正在使用JUnit执行测试,并创建一个具有上述所需功能的AndroidDriver
val appiumServerUrl = URL("http://localhost:4444/wd/hub")
val androidDriver = AndroidDriver<MobileElement>(appiumServerUrl, capabilities)
nodeconfig-wenda.json文件应与所需的功能相匹配
{
"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"
}
}
错误消息“无法从请求中提取功能”无助于理解问题。互联网上还有其他问题试图解决这类问题,但它们对我没有帮助。希望有人能提出一些建议
{
"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"
}
}