1

我正在尝试设置 Appium Grid 以进行并行执行。

出现问题的 Appium 版本(或 git 修订版):用于运行 Appium 的 1.13.1 桌面操作系统/版本:Windows 10 Node.js 版本(除非使用 Appium.app|exe):Nodejs Npm 或 Yarn 包管理器:通过运行 appium bat 文件 正在测试的移动平台/版本:Android 7.0 & 7.1.1 真实设备或模拟器/模拟器:Appium CLI 或 Appium.app|exe:appium -p 4725 --udid ZW3226GGPK -bp 5556 --chromedriver-port 5645 - -nodeconfig "D:\Workspace\fsp-app-automation\all.json" -g "D:\Workspace\fsp-app-automation\appium_1.log" --session-override

所需能力:

System.out.println(portNo+"---"+System.currentTimeMillis());
System.out.println(device_id + "---" + System.currentTimeMillis());
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, secondDeviceName);
capabilities.setCapability("udid", secondDeviceName);
capabilities.setCapability("platformVersion", "7.1.1");
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
//  capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
if (AppUtil.prop.containsKey("wait.activity")) {
capabilities.setCapability("appWaitActivity", AppUtil.WAIT_ACTIVITY);
} else {
capabilities.setCapability("appActivity", AppUtil.APP_ACTIVITY);
}
        capabilities.setCapability("package", AppUtil.BASE_PKG);
all.json

{
"capabilities":
[
{
"browserName": "Chrome",
"deviceName": "Appium",
"version":"7.0",
"maxInstances": 1,
"platformName":"ANDROID"
},
{
"browserName": "Chrome",
"deviceName": "Appium",
"version":"7.1.1",
"maxInstances": 1,
"platformName":"ANDROID"
}
],
"configuration":
{
"cleanUpCycle": 5000,
"registerCycle": 5000,
"nodeTimeout": 120,
"timeout": 600000,
"nodePolling": 2000,
"hub": "http://localhost:4444/grid/register",
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 10,
"port": 5555,
"host": "localhost",
"register": true,
"hubPort": 4444,
"hubHost" :"localhost",
"role": "node"
}  
}

服务器日志

D:\Workspace\fsp-app-automation>java -jar selenium-server-standalone-3.13.0.jar -role hub
11:53:11.800 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.13.0', revision: '2f0d292'
11:53:11.803 INFO [GridLauncherV3$2.launch] - Launching Selenium Grid hub on port 4444
2019-07-08 11:53:12.240:INFO::main: Logging initialized @975ms to org.seleniumhq.jetty9.util.log.StdErrLog
11:53:12.906 INFO [Hub.start] - Selenium Grid hub is up and running
11:53:12.907 INFO [Hub.start] - Nodes should register to http://10.190.50.136:4444/grid/register/
11:53:12.908 INFO [Hub.start] - Clients should connect to http://10.190.50.136:4444/wd/hub
11:53:28.134 INFO [DefaultGridRegistry.add] - Registered a node http://0.0.0.0:4726
11:53:32.296 INFO [DefaultGridRegistry.add] - Registered a node http://0.0.0.0:4725
2019-07-08 11:53:48.888:WARN:osjs.HttpChannel:qtp143110009-16: /wd/hub/session java.io.IOException: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {
"desiredCapabilities": {
"app": "D:\Workspace\fsp-app-automation\src\test\resources\com.globalagricentral.apk",
"package": "com.globalagricentral",
"platformVersion": "7.0",
"appWaitActivity": "*.LanguageActivity, .SplashActivity",
"platformName": "Android",
"udid": "ZW3226GGPK",
"deviceName": "ZW3226GGPK"
},
"capabilities": {
"firstMatch": [
{
"appium:app": "D:\Workspace\fsp-app-automation\src\test\resources\com.globalagricentral.apk",
"appium:appWaitActivity": ".LanguageActivity, .SplashActivity",
"appium:deviceName": "ZW3226GGPK",
"package": "com.globalagricentral",
"platformName": "android",
"appium:platformVersion": "7.0",
"appium:udid": "ZW3226GGPK"
}
]
}
}
2019-07-08 11:53:48.888:WARN:osjs.HttpChannel:qtp143110009-15: /wd/hub/session java.io.IOException: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {
"desiredCapabilities": {
"app": "D:\Workspace\fsp-app-automation\src\test\resources\com.globalagricentral.apk",
"package": "com.globalagricentral",
"platformVersion": "7.1.1",
"appWaitActivity": ".LanguageActivity, .SplashActivity",
"platformName": "Android",
"udid": "emulator-5554",
"deviceName": "emulator-5554"
},
"capabilities": {
"firstMatch": [
{
"appium:app": "D:\Workspace\fsp-app-automation\src\test\resources\com.globalagricentral.apk",
"appium:appWaitActivity": ".LanguageActivity, *.SplashActivity",
"appium:deviceName": "emulator-5554",
"package": "com.globalagricentral",
"platformName": "android",
"appium:platformVersion": "7.1.1",
"appium:udid": "emulator-5554"
}
]
}
}
4

0 回答 0