SRK
SRK

Reputation: 128

how to Run selenium code in different browser versions in same Node?

I am trying to run one test on different version of browser exes present in node. How I can pass version info in code and how to configure node to accept those arguement?

Upvotes: 2

Views: 3958

Answers (1)

Paras
Paras

Reputation: 3235

For running different browser versions on same node, you need to follow below steps.

Install all the required browser versions on the node machine in case of Firefox browser and in case of ChromeDriver or IEDriver Keep different binary versions.

Now you need to mention all the browser version in the node_config file which you have referred in your comment NodeConfig.

e.g.:- you can mention different browser versions in your node_config file as mentioned below, I've used 2 different firefox versions.

{
      "browserName": "firefox",
      "maxInstances": 3,
      "version": 40,
      "seleniumProtocol": "WebDriver"
    },
    {
      "browserName": "firefox",
      "maxInstances": 3,
      "version":38, 
      "seleniumProtocol": "WebDriver"
    },
    {
      "browserName": "chrome",
      "maxInstances": 5,
      "seleniumProtocol": "WebDriver"
    }
}

Now you can launch your node with the same config and you would be able to see 2 different browser versions on your Selenium Grid console.

Selenium Grid Console

Once you are able to setup your node, you can just run the code on your Grid hub and it will take care of browser distribution.

Upvotes: 2

Related Questions