Brimstedt
Brimstedt

Reputation: 3140

Specifying a specific browser version in a selenium test run

I have two windows Selenium slaves, one with IE9 and one with IE10.

The nodes are configured using node json config:

    {
      "browserName": "internet explorer",
      "maxInstances": 5,
      "seleniumProtocol": "WebDriver",
      "version": 10
    }

And in the test (running through Robotframework and Selenium2Library):

Open test browser
    Log to console  Open ${siteUrlFull} in ${browser}
    Open browser  ${siteUrlFull}
    ...  remote_url=http://192.168.10.207:4443/wd/hub
    ...  desired_capabilities=version:10,browserName:${browser}

However, the test keeps failing with the error:

WebDriverException: Message: Error forwarding the new session cannot find : Capabilities [{marionette=false, browserName=internet explorer, javascriptEnabled=true, version=9, platform=ANY, firefox_profile=UEsDBBQAAAAIACJxREjOFgm64wIAA...}]

The hub status page shows clearly that the browsers are configured with a "9" and a "10" in front of the IE icons.

But for some reason, Selenium refuses to accept the version request.

Upvotes: 0

Views: 571

Answers (1)

Brimstedt
Brimstedt

Reputation: 3140

It turned out that the version property is a string and thus must be specified as such in the node config:

    {
      "browserName": "internet explorer",
      "maxInstances": 5,
      "seleniumProtocol": "WebDriver",
      "version": "10" <-.
    }                   |
 >--------Quotes!-------'

Upvotes: 1

Related Questions