私は Selenium に取り組んでおり、現在、すべてのブラウザーで Linux を実行している 2 つの VM にハブが接続されています。
ブラウザを起動できました。ただし、2 つの VM がある場合でも、すべてのテストは 1 つの VM 上の 1 つのブラウザーで実行されます。Selenium は、VM で複数のブラウザーを起動しません。最大インスタンスを 5 に設定すると、gris コンソールに反映されます。Linux と Windows vm で実行する必要があるテストスイートがあり、同時に実行する必要があります。WebDriver を使用して、このようにグリッドを呼び出します。
capabilities = new DesiredCapabilities();
capabilities.setBrowserName("firefox");
driver = new RemoteWebDriver(new URL("http://XXX.XXX.XXX.:4444/wd/hub"), capabilities);
そして、これが私のテスト スイートの作成方法です。
testNames.add(SupportPortalTestSuite.class.getName());
JUnitCore.main(testNames.toArray(new String[testNames.size()]));
また、ノードを登録すると、次のようになります。
11:28:47.403 INFO - using the json request : {"class":"org.openqa.grid.common.RegistrationRequest","capabilities":[{"platform":"LINUX","seleniumProtocol":"Selenium","browserName":"*firefox","maxInstances":5},{"platform":"LINUX","seleniumProtocol":"Selenium","browserName":"*googlechrome","maxInstances":5},{"platform":"LINUX","seleniumProtocol":"Selenium","browserName":"*iexplore","maxInstances":1},{"platform":"LINUX","seleniumProtocol":"WebDriver","browserName":"firefox","maxInstances":5},{"platform":"LINUX","seleniumProtocol":"WebDriver","browserName":"chrome","maxInstances":5},{"platform":"WINDOWS","seleniumProtocol":"WebDriver","browserName":"internet explorer","maxInstances":1}],"configuration":{"port":5555,"register":true,"host":"10.235.132.161","proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","maxSession":5,"hubHost":"10.235.1.50","role":"node","registerCycle":5000,"hub":"http://10.235.1.50:4444/grid/register","hubPort":4444,"url":"http://10.235.132.161:5555","remoteHost":"http://10.235.132.161:5555"}}
11:28:47.407 INFO - starting auto register thread. Will try to register every 5000 ms.
VM で使用可能なすべてのブラウザで同時にテストを実行する必要があります。