Networking 区分不同的Selenium网格节点

Networking 区分不同的Selenium网格节点,networking,selenium-grid,Networking,Selenium Grid,我现在正在处理以下问题: 我的Selenium网格实例应该连接几个位于不同位置的节点,我希望在每个位置运行每个测试。我如何指出Selenium网格应该从每个位置选择一个节点并将测试发送到那个里?我试图操纵浏览器名称或平台(例如,将其命名为firefox pl/firefox fr或windows pl/windows fr),但始终收到以下异常: Selenium::WebDriver::Error::UnknownError: Error forwarding the new

我现在正在处理以下问题:

我的Selenium网格实例应该连接几个位于不同位置的节点,我希望在每个位置运行每个测试。我如何指出Selenium网格应该从每个位置选择一个节点并将测试发送到那个里?我试图操纵浏览器名称或平台(例如,将其命名为firefox pl/firefox fr或windows pl/windows fr),但始终收到以下异常:

     Selenium::WebDriver::Error::UnknownError:
   Error forwarding the new session cannot find
我发现这些值是不可变的


还有其他方法吗?我不想更改浏览器或其版本,因为这些测试的本质是比较不同位置上的网络响应,不同的浏览器可以更改它。

听起来您希望并行运行测试,testng是帮助您设置的一个很好的工具。请看下面的链接


当启动节点并指定能力时,可以考虑设置Max实例。此值控制可在该节点上打开的浏览器的并发实例数。如果将其设置为1,则可以对网格并行运行测试,但每个节点上一次只能打开一个浏览器

java.exe-jar selenium-server.jar-角色节点-浏览器 browserName=firefox,maxInstances=1,platform=ANY,seleniumProtocol=WebDriver


我也遇到了同样的情况,我只想到了节点,并做了如下操作

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);". 
在节点中设置应用程序名称是selenium中的隐藏功能。现在只需测试和享受