Distinguish different Selenium Grid node

后端 未结 3 1280
被撕碎了的回忆
被撕碎了的回忆 2021-01-16 03:14

I\'m dealing right now with following problem:

My Selenium Grid instance should connect few nodes which are in different locations and I would like to run each test

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-16 03:42

    I also come across same situation and I just think of the node and did as follows.

    In one folder 
      1.place the selenium-server-standalone-2.44.0.jar file and set the environment variable as well.
    
      2.create the hub: Type "java -jar selenium-server-standalone-2.44.0.jar -role hub -port 4444" in the text file and save it as Hub.bat and run it
    
      3.Create the node: Type "java -jar selenium-server-standalone-2.44.0.jar -role node -hub http://(IP Address of the parent machine which has above two files):4444/grid/register -port 8882 -browser "browserName=firefox,maxInstances=1,applicationName=two"" and put this file in another machine and run this. Now this node will be connected with the hub.
    
      4.If you want particular test should run in one node(client machine) then you can just specify the applicationName in the node as like in above point(3) and in setting the capabilities in the test class file as "desiredCapability.setCapability("applicationName", nodeName);". 
    

    setting the application name in the node is hidden features in selenium. Now just test and enjoy.

提交回复
热议问题