groupon / Selenium-Grid-Extras

Simplify the management of the Selenium Grid Nodes and stabilize said nodes by cleaning up the test environment after the build has been completed
BSD 3-Clause "New" or "Revised" License
536 stars 210 forks source link

Selenium grid extra strips hub tag resulting in default value #357

Open shankarkc opened 7 years ago

shankarkc commented 7 years ago

I have node.json as shown below

{
  "capabilities": [
    {
      "seleniumProtocol": "WebDriver",
      "extension.sikuliCapability": true,
      "browserName": "firefox",
      "maxInstances": 1,
      "version": "replaceFireFoxVersionHere",
      "platform": "LINUX"
    },
    {
      "seleniumProtocol": "WebDriver",
      "extension.sikuliCapability": true,
      "browserName": "chrome",
      "maxInstances": 1,
      "version": "replaceChromeVersionHere",
      "platform": "LINUX"
    }
  ],
  "proxy": "com.groupon.seleniumgridextras.grid.proxies.SetupTeardownProxy",
  "servlets": [
    "io.sterodium.extensions.node.SikuliExtensionServlet",
    "io.sterodium.extensions.node.upload.FileUploadServlet",
    "io.sterodium.extensions.node.download.FileDownloadServlet"
  ],
  "maxSession": 1,
  "host": "ee0f37e38405",
  "port": 5555,
  "register": true,
  "unregisterIfStillDownAfter": 10000,
  "hubPort": 4444,
  "hubHost": "SeleniumHub" ,
  "hub": "http://SeleniumHub:4444",
  "nodeStatusCheckTimeout": 10000,
  "downPollingLimit": 0
}

Once the selenium grid extra reads the config and rewrites it it becomes

{
  "capabilities": [
    {
      "seleniumProtocol": "WebDriver",
      "extension.sikuliCapability": true,
      "browserName": "firefox",
      "maxInstances": 1,
      "version": "52.0.2",
      "platform": "LINUX"
    },
    {
      "seleniumProtocol": "WebDriver",
      "extension.sikuliCapability": true,
      "browserName": "chrome",
      "maxInstances": 1,
      "version": "59.0.3071.115",
      "platform": "LINUX"
    }
  ],
  "loadedFromFile": "node_5555.json",
  "proxy": "com.groupon.seleniumgridextras.grid.proxies.SetupTeardownProxy",
  "servlets": [
    "io.sterodium.extensions.node.SikuliExtensionServlet",
    "io.sterodium.extensions.node.upload.FileUploadServlet",
    "io.sterodium.extensions.node.download.FileDownloadServlet"
  ],
  "maxSession": 1,
  "port": 5555,
  "register": true,
  "unregisterIfStillDownAfter": 10000,
  "hubPort": 4444,
  "hubHost": "SeleniumHub",
  "host": "ee0f37e38405",
  "nodeStatusCheckTimeout": 10000,
  "custom": {},
  "downPollingLimit": 0
}

As hub details stripped and passed to seleniumStandalone jar Nodes show hub tag as

hub: http://localhost:4444

as this tag is defaulted. We need to pass the hub tag as it is to seleniumStandalone jar if user passes it. Otherwise it will result in wrong value ( though user specified it as part of node json file)

smccarthy commented 6 years ago

@shankarkc Thanks for bringing this up. I am sorry I didn't see this before now. I can maybe get this added in a PR later this week (if its as simple as just adding it where the rest of the values are).

shankarkc commented 6 years ago

Thanks @smccarthy