环境准备
TestNG + Grid + Webdriver
1.启动Grid hub + node
hub端:
java -jar selenium-server-standalone-2.4x0.jar -role node -hub
|
Node 端
java -jar selenium-server-standalone-2.4x0.jar -role webdriver -hub http://hubIP:port/grid/register -port 5555
2.测试代码如图
![selenium + testng + grid 例子 selenium + testng + grid 例子](https://cdn.ancii.com/article/image/v1/xu/R7/E9/9ERu7xJyTqCFW_cllJux0Mp_80uPLRnGBDUptGwNa0NwVY9hhrzMDGcG_JaCUuIwPfqUvxwEKTdwlZV8WWlAwXWRPv08HuGOokY-K7nnoLuPODtwXkkk7rYx7kg6fcgB.png)
|
3.TestNG配置如图
![selenium + testng + grid 例子 selenium + testng + grid 例子](https://cdn.ancii.com/article/image/v1/xu/R7/E9/9ERu7xJyTqCFW_cllJux0Mp_80uPLRnGBDUptGwNa0MOpZWFaoIwJianq8Jpa4gMduGkiQtHRS1slpjZq12hCbC03ftwcpgz61EEzMCdHrOvfuXAmltgMIfbzcc2dSf1.png)
4.结果如图
![selenium + testng + grid 例子 selenium + testng + grid 例子](https://cdn.ancii.com/article/image/v1/xu/R7/E9/9ERu7xJyTqCFW_cllJux0Mp_80uPLRnGBDUptGwNa0PbSsPZZ0fM2nqR7p1PFYuCe2srG1Xnx1yI1njhe02ZOZdE0KJCO3s3pezoCOx0BXcv1kCcMEoPaQ-lcgBBYWRY.png)