I am using selenium grid(JUNIT, Java) to run my test case on mutli instance of browser.
I used "java -jar selenium-server-standalone-2.20.0.jar -role hub" to run hub.
and "java -jar selenium-server-standalone-2.20.0.jar -role webdriver -hub http://machineip
:4444/grid/register -port 5566" to run node.
I verified that both are running fine.
But when I run testcase through eclipse only one instace of browser opened.
i used this piece of code.
@Test
public void method() throws MalformedURLException {
baseUrl = "https://www.google.co.in";
nodeUrl = "http://`machinip`:5566/wd/hub";
DesiredCapabilities capability = DesiredCapabilities.firefox();
capability.setBrowserName("firefox");
capability.setPlatform(Platform.WINDOWS);
driver = new RemoteWebDriver(new URL(nodeUrl), capability);
// WebDriver driver = new FirefoxDriver();
driver.get(baseUrl);
driver.findElement(By.xpath("//td/div/input")).sendKeys("lucky");
}
Can please someone suggest how can i open multiple instance for single test.
Thanks in advance for help.