实践步骤

下载 selenium-server-standalone-xxx.jar

java -jar selenium-server-standalone-3.0.1.jar  -port 4444 -role hub

设置不同的端口 appium json 文件信息

{
  "capabilities": [
    {
      "deviceName": "DU2TAN15AJ049163",
      "version": "4.4.2",
      "maxInstances": 3,
      "platform": "ANDROID",
      "browserName": "chrome"
    }
  ],
  "configuration": {
      "cleanUpCycle": 2000,
      "timeout": 300000,
      "browserTimeout": 60000,
      "hub":"127.0.0.1:4444/grid/register",
      "host":"192.168.1.218",
      "maxSession": 6,
      "port": 4723,
      "hubPort": 4444,
      "hubHost": "192.168.1.218",
      "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
      "url": "http://127.0.0.1:4723/wd/hub",
      "register": true,
      "registerCycle": 5000
    }
}
node D:\\app\Appium\\node_modules\\appium\\bin\\appium.js  -p 4723  -U DU2TAN15AJ049163 --nodeconfig D:\app\appium_study\testRunner\test.json

{
  "capabilities": [
    {
      "deviceName": "MSM8926", #设备id
      "version": "4.3",
      "maxInstances": 3,
      "platform": "ANDROID",
      "browserName": "chrome"
    }
  ],
  "configuration": {
      "cleanUpCycle": 2000,
      "timeout": 300000,
      "browserTimeout": 60000,
      "hub":"127.0.0.1:4444/grid/register", #链接hub
      "host":"192.168.1.218",
      "maxSession": 6,
      "port": 4724,#端口号
      "hubPort": 4444,
      "hubHost": "192.168.1.218",
      "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
      "url": "http://127.0.0.1:4724/wd/hub",# 4724 appium服务器
      "register": true,
      "registerCycle": 5000
    }
}
node D:\\app\Appium\\node_modules\\appium\\bin\\appium.js  -p 4724  -U MSM8926--nodeconfig D:\app\appium_study\testRunner\test2.json

在看看刚刚执行 selenium-server-standalone 窗口

在浏览器中预览

在浏览器输入:http://192.168.1.218:4444/grid/console 就能看到你连接了多少个设备

其他


↙↙↙阅读原文可查看相关链接,并与作者交流