Selenium Grid | Hub Configuration

Hub Configuration

Selenium Grid | Hub Configuration

Let’s learn about Hub Configuration.

  • To run the hub using the default options simply specify role hub to the Selenim-Server
  • java -jar selenium-server-standalone-2.44.0.jar -hub
  • You should see the following logging output.
  • Jul 19, 2012 10:46:21 AM org.openqa.grid.selenium.GridLauncher main
  • INFO: Launching a selenium grid server
  • 2012-07-19 10:46:25.082:INFO:osjs.Server:jetty-7.x.y-SNAPSHOT
  • 2012-07-19 10:46:25.151:INFO:osjsh.ContextHandler:started o.s.j.s.ServletContextHandler{/,null}
  • 2012-07-19 10:46:25.185:INFO:osjs.AbstractConnector:Started [email protected]:4444

 Specifying the Port – The default port used by the hub is 4444. The port being referred to here, is the TCP/IP port used when the ‘client’, that is, the automated tests connect to the Selenium-Grid hub. If another application on computer is already using this port, or if, you already have a Selenium-Server started, you’ll see the following message in the log output.

10:56:35.490 WARN – Failed to start: [email protected]:4444

Exception in thread “main” java.net.BindException: Selenium is already running on port 4444. Or some other service is,

  • If this occurs you can either shutdown the other process that is using port 4444, or you can tell Selenium-Grid to use a different port for its hub. Use the -port option for changing the port used by the hub.
  • java -jar selenium-server-standalone-2.44.0.jar -role hub -port 4441
  • This will work even if another hub is already running on the same machine, that is, as long as they’re both not using port 4441.
  • You may, however, want to see what process is using port 4444 so you can allow the hub to use the default. To see the ports used by all running programs on machine use the command.
  • netstat -a
  • This should work on all supported systems, Unix/Linux, MacOs, and Windows although additional options beyond -a may be required. Basically you need to display the process ID along with the port. In Unix you may ‘grep’ the output (use a pipe) from the port number to only display those records you’re concerned with.

 

Selenium professional free practice test

Go back to Tutorial                                                                                Go to Home Page

Get industry recognized certification – Contact us

Menu