Home > other >  Why do we need org.openqa.grid.selenium.GridLauncherV3 in selenium grid
Why do we need org.openqa.grid.selenium.GridLauncherV3 in selenium grid

Time:09-01

Is there any specific reason why we use GridlauncherV3, Currently doing a project where I use custom servlets for executing some task

For launching node:

java -Dwebdriver.chrome.driver=chromedriver -cp testservlet.jar:selenium-server-standalone.jar org.openqa.grid.selenium.GridLauncherV3 -role node -maxSession 10 -port 4444 -host localhost -hub http://localhost:4444/grid/register -browser browserName=chrome,version=103,platform=LINUX,maxInstances=10 -servlets testservlet.copies.DemoServlet,testservlet.copies.Demo2Servlet 

Couldn't find any reason but if removed it throws an error, Were it needs a params

Unrecognized option: -role
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Thanks in advance.

CodePudding user response:

As you are using are using java -cp, it is a requirement to specify the class that contains the main() method.

In the case of creating a jvm to run as selenium grid, you require the class that contains the main() method, in this case that is org.openqa.grid.selenium.GridLauncherV3.

This method is used to initiate the grid with all the required configuration in your cli command.

See the method here: GridLauncherV3

  • Related