Ulaga Sundar Ulaga Sundar - 24 days ago 10
Java Question

Can not open Multiple Browser by using selenium grid

I am new to selenium grid. I want to do testing in parallel mode. I tried as like following. But it won't open the multiple browsers. I don't know what I have done wrongly.

My Code :

for(int i=0;i<=10;i++){
RemoteWebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), DesiredCapabilities.firefox());
driver.navigate().to("http://gmail.com");
}


Selenium Hub:

java -jar selenium-server-standalone-2.52.0.jar -role hub


Selenium Node:

java -jar selenium-server-standalone-2.52.0.jar -role node -hub http://localhost:4444/grid/register -port 5560 -browser browserName=firefox,maxInstance=3 -maxSession 3


Info Prints in Hub :

16:38:28.581 INFO - Available nodes: [http://192.168.1.28:5560]


16:38:28.581 INFO - Trying to create a new session on node http://192.168.1.28:5560

Configuration

Answer

I have found the solution for this. I only did the mistake in the command.

I should used maxInstance instead of maxInstances

The command should be like this

java -jar selenium-server-standalone-2.52.0.jar -role node -hub http://localhost:4444/grid/register -port 5580 -browser browserName=firefox,maxInstances=3 -maxSession=3