appium并行测试
本帖最后由 悠悠小仙仙 于 2019-6-18 10:39 编辑appium并行测试
[*]想同时启动多个appium并行运行,谷歌后,很多资料都显示用selenium grid 的方式。找到一张效果图
[*]
实践步骤下载selenium-server-standalone-xxx.jar
[*]执行命令
<code style="font-family:Menlo, Monaco, Consolas, 'Courier New', monospace;display:block;line-height:18px;border:none !important;">java -jar selenium-server-standalone-3.0.1.jar-port 4444 -role hub
</code>
设置不同的端口appium json文件信息
[*]配置json1 端口4723文件
{
"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
}
}
[*]执行命名,启动端口4723连接hub
<code style="font-family:Menlo, Monaco, Consolas, 'Courier New', monospace;display:block;line-height:18px;border:none !important;">node D:\\app\Appium\\node_modules\\appium\\bin\\appium.js-p 4723-U DU2TAN15AJ049163 --nodeconfig D:\app\appium_study\testRunner\test.json
</code>
{
"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
}
}
[*]执行命名,启动端口4724连接hub
<code style="font-family:Menlo, Monaco, Consolas, 'Courier New', monospace;display:block;line-height:18px;border:none !important;">node D:\\app\Appium\\node_modules\\appium\\bin\\appium.js-p 4724-U MSM8926--nodeconfig D:\app\appium_study\testRunner\test2.json
</code>
在看看刚刚执行selenium-server-standalone窗口
在浏览器中预览在浏览器输入:http://192.168.1.218:4444/grid/console 就能看到你连接了多少个设备其他
[*]这种方式也可以启动多个web 浏览器的方式,用于多个web自动化测试
[*]关于代码对接,还没有对接成功到代码中,如何启动不同的driver,不同的driver放到线程中,现在还没有想好怎么做比较好,有其他想法的小伙伴麻烦帮忙指导下思路
页:
[1]