6

I'm using Selenium for automated testing. What's the difference between

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

and

java -jar selenium-server-standalone-2.24.1.jar -role webdriver

?

It seems to be the same. Or is there any difference?

ccman
  • 1,133
  • 1
  • 8
  • 10
  • role hub opens a [Selenium Grid](http://code.google.com/p/selenium/wiki/Grid2) hub & role webdriver fails for me – Franz Ebner Jul 20 '12 at 12:57
  • `-role webdriver` parameter is required from version 3.8 I believe onwards; if you just used the standalone server as a hub+node. The difference is that a `-role hub` can connect your client, to any of multiple nodes, (`-role node` which must register or point to the `-role hub` machine) it then becomes a grid or farm. This all changes in Selenium 4 where things get less "hard-coded" to manage multiple nodes. https://www.selenium.dev/documentation/en/grid/ – Conrad B Oct 20 '20 at 13:57

2 Answers2

1

Quoting from the official wiki page:

The Hub is the central point that will receive all the test request and distribute them the the right nodes.

Regardless on whether you want to run a grid with new WebDriver functionality, or a grid with Selenium 1 RC functionality, or both at the same time, you use the same selenium-server-standalone jar file to start the nodes.

My personal thought: The node is used for Selenium 1 (RC) and webdriver for selenium 2 (webdriver). In my personal setup i use role webdriver

If the wiki is not enough, I would suggest you to join Selenium users group

Pavel Janicek
  • 12,577
  • 12
  • 47
  • 76
-1

Everything depends on the capabilities of node, below json file shows the seleniumProtocol values and based on that it reflects the RCs and Webdrivers on grid.

  "capabilities":
      [
        {
          "browserName": "*firefox",
          "maxInstances": 2,
          "seleniumProtocol": "Selenium"
        },
        {
          "browserName": "*googlechrome",
          "maxInstances": 2,
          "seleniumProtocol": "Selenium"
        },
        {
          "browserName": "*iexplore",
          "maxInstances": 1,
          "seleniumProtocol": "Selenium"
        },
    {
          "browserName": "firefox",
          "maxInstances": 5,
          "seleniumProtocol": "WebDriver"
        },
        {
          "browserName": "chrome",
          "maxInstances": 5,
          "seleniumProtocol": "WebDriver"
        },
        {
          "browserName": "internet explorer",
          "maxInstances": 1,
          "seleniumProtocol": "WebDriver"
        }

Always shows both RC and webdriver instances on grid whether we given node or webdriver on command line

enter image description here

Ram
  • 2,972
  • 10
  • 38
  • 56