Selenium: difference between "role hub" and "role webdriver"?
Asked Answered
D

2

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?

Diazole answered 20/7, 2012 at 12:13 Comment(2)
role hub opens a Selenium Grid hub & role webdriver fails for meStacte
-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. selenium.dev/documentation/en/gridMilwaukee
L
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

Luann answered 20/7, 2012 at 12:53 Comment(0)
J
-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

Jagged answered 15/2, 2015 at 18:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.