How to Install Selenium Grid in Linux



How to Install Selenium Grid on Linux


  • How to install selenium server jar in Linux?

  • Create folder:
sudo mkdir ~/selenium
cd ~/selenium
  • Get Selenium and install headless Java runtime
sudo wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
  • Run Selenium server as hub:
java -jar selenium-server-standalone-2.53.1.jar -role hub -port 4444


  • Run Selenium server in nodes:


java -jar selenium-server-standalone-2.53.1.jar -role node -hub http://172.31.22.212:4444/grid/register -Dwebdriver.chrome.driver="C:/Users/Administrator/Desktop/chromedriver.exe" -browser "browserName=chrome,maxInstances=5,maxSessions=5" -port 5556
java -jar selenium-server-standalone-2.53.1.jar -role node -hub http://172.31.22.212:4444/grid/register -Dwebdriver.ie.driver="C:/Users/Administrator/Desktop/IEDriverServer.exe" -browser "browserName=internet explorer,maxInstances=5,maxSessions=5" -port 5557
java -jar selenium-server-standalone-2.53.1.jar -role node -hub http://172.31.22.212:4444/grid/register -browser "browserName=firefox,maxInstances=5,maxSessions=5" -port 5558


  • Linux, get processes list:
  • ps aux | less


  • Linux kill process:
  • Kill -9 PID


  • Linux, download UZIP:
  • sudo yum install unzip


Start Nodes Using JSON File:
You have to create JSON file with these configurations for 3 supported browsers:
{
 "capabilities":
     [
       {
         "browserName": "firefox",
         "maxInstances": 5,
         "seleniumProtocol": "WebDriver"
       },
       {
         "browserName": "chrome",
         "maxInstances": 5,
         "seleniumProtocol": "WebDriver"
       },
       {
         "browserName": "internet explorer",
         "maxInstances": 5,
         "seleniumProtocol": "WebDriver"
       }
     ],
 "configuration":
 {
   "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
   "maxSession": 5,
   "port": 5556,
   "register": true,
   "registerCycle": 5000,
   "hubPort": 4444,
   "hub": "http://172.31.27.83:4444/grid/register",
   "hubHost": "172.31.27.83"
 }
}


To start the nodes, you have to execute this command:
  • java -jar  selenium-server-standalone-2.53.1.jar -role node -nodeConfig config.json

Comments

  1. I pay a visit day-to-day some blogs and information sites to read articles or reviews, however this web site gives quality based writing.

    ReplyDelete

Post a Comment

Popular posts from this blog

Handling Selenium Grid Exceptions

How to Customize TestNG Emailable Report ?