0

I build selenoid docker images for firefox myself and have them configured in the browsers.json as follows:

 "firefox": {
    "default": "66.0",
    "versions": {
      "beta": {
        "image": "my/path/to/firefox:beta",
        "port": "4444"
      },
      "66.0": {
        "image": "selenoid/vnc:firefox_66.0",
        "port": "4444"
      }
    }
  }

Sending the version=beta capability causes the webdriver to throw

selenium.WebDriverException: Requested environment is not available

In the logs I found

2019/04/03 08:17:29 [3] [PROXY_TO] [90ab834d22aa3bbe2731eeb550497eec7ef9fb11c1e7f4609d617cf6a25124e7] [http://172.17.0.4:4444]
2019/04/03 08:17:29 [3] [SESSION_ATTEMPTED] [http://172.17.0.4:4444] [1]
2019/04/03 08:17:29 [3] [SESSION_ATTEMPTED] [http://172.17.0.4:4444/wd/hub] [2]
2019/04/03 08:17:29 [3] [SESSION_FAILED] [http://172.17.0.4:4444/wd/hub] [400 Bad Request]

Since the exact same thing works for chrome and it also works if I set "default": "beta" in the browsers.json and do not set the version capability, I assume this happens because geckodrivers matches the version from the capabilites against the actual browser version. (as presumed here).

I have several ideas how to work around this, but do not know how to technically implement these:

  • Prevent Selenoid from passing the version capability to the selenium driver (geckodriver in this case)
  • Prevent geckodriver from checking version capability and browser version
  • Add another flag to selenoid to get the docker image from browsers.json such as browser_version instead of version
  • Add another fake browser to browsers.json and set the beta to default, then just set the browserName capability. The problem here is, selenoid checks for the browser names and if it does not match chrome, firefox or opera the selenoid container cannot be started. E.g.:

browserName=firefox-beta

 "firefox-beta": {
    "default": "beta",
    "versions": {
      "beta": {
        "image": "my/path/to/firefox:beta",
        "port": "4444"
      }
    }
  }

Any help or further information will be greatly appreciated

Community
  • 1
  • 1
Carle B. Navy
  • 1,156
  • 10
  • 28
  • Selenoid supports `browserVersion` capability, too. – vania-pooh Apr 04 '19 at 14:53
  • @vania-pooh Setting `browserVersion=beta` still results in geckodriver throwing an exception. I think you can not set another value as a version than the browsers actual version, which does not seem to work for beta versions. – Carle B. Navy Apr 05 '19 at 11:16

1 Answers1

0

For w3c compliant browsers (as of today, only non-Chrome), they require the browser version to be in the browserVersion capability instead of version. I see you tried browser_version, but did you try browserVersion?

https://www.w3.org/TR/webdriver1/#capabilities

Lucas Tierney
  • 2,503
  • 15
  • 13
  • The problem is not that `version` is not recognized by the geckodriver but rather that it **is recognized**. I have to set the `version=beta` capability in order for selenoid to use the right docker image. Selenoid then passes all my capabilities to the webdriver and this is the problem. The geckodriver tries to match the browser version set in the capabilities with the one of the installed browser. And as I pass the version `beta` and the browser does not have the version `beta` but something like `67.0.123` the webdriver throws an exception. – Carle B. Navy Apr 04 '19 at 07:52