Selenium grid 分布式测试搭建

第一步:准备2台电脑,且2台电脑都安装好jdk,都准备好selenium-server-standalone-2.40.0.jar,IEDriver, ChromeDriver等工具,注意chrome版本与chromedriver需要匹配,详见我的另一篇博客:http://www.cnblogs.com/cherrysu/p/7815245.html

第二步:其中一台电脑作为hub,也就是老大,另一台作为node,也就是小弟,两台电脑一定要能ping通。

第三步:hub机上新建HUB.bat, 内容参考:  

java -jar C:\\Software\\selenium\\selenium-server-standalone-2.40.0.jar -role hub

  其中selenium-server-standalone-2.40.0.jar 的版本和路径需要改成自己的。

第四步:node机上新建node.bat,内容参考:  

java -Dwebdriver.chrome.driver="C:\\software\\chromedriver.exe" -Dwebdriver.ie.driver="C:\\software\\IEDriverServer-x64.exe" -jar C:\\libs\\selenium-server-standalone-2.40.0.jar -role node -nodeConfig node.json -hub http://hub机IP:4444/grid/register

  其中 chromedriver.exe,IEDriverServer-x64.exe,standalone都需要改为node机上对应的地址, -nodeConfig node.json可以修改node机上的grid参数,具体内容参考:

{

"capabilities": [
{
"browserName": "chrome",
"maxInstances": 5,
"platform": "WINDOWS",
"version":"51"
},
{
"browserName": "internet explorer",
"maxInstances": 2,
"platform": "WINDOWS",
"webdriver.ie.driver": "IEDriverServer.exe"
}
],
"configuration": {
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 5,
"port": 5555,
"register": true,
"registerCycle": 5000,
"hub": "http://192.168.84.209:4444"
}
}

第五步:先运行hub.bat,在运行node.bat,在hub机上打开 http://localhost:4444/grid/console# 查看链接状态

第六步:编写python脚本

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值