1.hub主机 java -jar selenium-server-standalone-3.141.59.jar -role hub
2.启动node节点appium
1)appium桌面版:
node 节点执行 命令行要管理员执行
node.exe "C:Program Files (x86)Appium esourcesapp ode_modulesappiumuildlibmain.js" --nodeconfig "c: est.json" -p 4723
2)appium server版
appium -p 4723
--nodeconfig c: est.json
3)注 test.json 内容 如下:
{
"capabilities": [
{
"deviceName": "464a58424f573098",
"version": "9",
"maxInstances":5,
"platform": "ANDROID",
"browserName": "chrome"
}
],
"configuration":
{
"cleanUpCycle":"2000",
"timeout":"30000",
"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://10.2.40.24:4723/wd/hub",
"host":"10.2.40.24",
"port":"4723",
"maxSession":"5",
"register":true,
"registerCycle":"5000",
"hubPort":"4444",
"hubHost":"10.2.40.11"
}
}
注 :40.24 为node节点 40.11为主机hub
3.代码修改 这里使用为主机hub 的ip+端口
AppiumDriver.appium_driver = webdriver.Remote('http://10.2.40.11:4444/wd/hub', desired_caps)