I'm using selenium-2.42.2 in Windows 7, I started a hub and typed "java -jar selenium-server-standalone.jar -role node -nodeConfig nodeconfig.json -Dwebdriver.chrome.driver= D:\selenium\chromedriver.exe" in terminal, following is junit 4 test case :
public void setUp() throws Exception {
driver = new ChromeDriver();
baseUrl = "http://127.0.0.1:8443/";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void testWebdriver() throws Exception {
driver.get(baseUrl + "/customizedfolder/main.html");
for (int second = 0;; second++) {
if (second >= 60) fail("timeout");
try { if (isElementPresent(By.xpath("//div[@id='f21TemFolder']/div/span"))) break; } catch (Exception e) {}
Thread.sleep(1000);
}
driver.findElement(By.xpath("//div[@id='f21TemFolder']/div/span")).click();
}
Below nodeconfig.jso code :
{
"capabilities": [
{ "browserName": "*firefox", "seleniumProtocol":"Selenium","platform": "LINUX", "maxInstances": 3 },
{"browserName": "*chrome", "seleniumProtocol":"WebDriver","platform": "LINUX", "maxInstances": 3 }
],
"configuration": { "nodeTimeout":120, "port":5555, "hubPort":4444, "hubHost":"localhost", "nodePolling":2000, "registerCycle":10000, "register":true, "cleanUpCycle":2000, "timeout":30000, "maxSession":1, }
}
but there is problem in opening chrome browser.
The error is: the path to the driver executable must be set by the webdriver.chrome.driver system property....
I also set webdriver.chrome.driver in system property, but failed too.
Chrome version is : 36.0.1985.143 m, chrome driver version is :2.10 how to use chrome in selenium grid 2?