Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can i use selenium grid on single machine

I don't have multiple machines at my job. I have one window and one mac for script execution. I was wondering if i can use selenium grid for script execution on single machine.I never used selenium grid. Any article, links or suggestion is highly appreciated.

like image 988
Syed Avatar asked Dec 15 '22 13:12

Syed


1 Answers

Yes, you can start a selenium gird with multiple node on single machine, but RAM should be at least 8GB because it will running test suites with more than 4 browser instance it need more RAM if not browser gets closed. http://selenium-release.storage.googleapis.com/index.html Download standalone jar.

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

It will start hub .

To start nodes open different cmd and type following command to start 'n' number nodes. The command is below:

java -jar lib/selenium-server-standalone-2.43.1.jar -role node  -hub http://localhost:4444/grid/register -port 5555

java -jar lib/selenium-server-standalone-2.43.1.jar -role node  -hub http://localhost:4444/grid/register -port 6666

java -jar lib/selenium-server-standalone-2.43.1.jar -role node  -hub http://localhost:4444/grid/register -port 7777

If you want to run same test case in different browser download the browser drivers here

Run the following command to start different browsers: For example:

java -jar selenium-server-standalone-2.45.0.jar -role webdriver -hub http://localhost:4444/grid/register -Dwebdriver.chrome.driver=C:\Users\xyz\Desktop\chromedriver.exe

java -jar selenium-server-standalone-2.45.0.jar -role webdriver -hub http://localhost:4444/grid/register -port 6666 -Dwebdriver.chrome.driver=C:\Users\xyz\Desktop\chromedriver.exe.

This will start chrome browser and node.

like image 98
Naveen Avatar answered Dec 18 '22 10:12

Naveen