【问题标题】:Selenoid: why can't I run specific browser version?Selenoid:为什么我不能运行特定的浏览器版本?
【发布时间】:2018-06-06 11:54:39
【问题描述】:

我有如下配置文件browser.json:

{
    "chrome": {
        "default": "69.0",
        "versions": {
            "60.0": {
                "image": "selenoid/chrome:60.0",
                "port": "4444",
                "path": "/",
                "tmpfs": {
                    "/tmp": "size=128m"
                }
            },
            "69.0": {
                "image": "selenoid/chrome:69.0",
                "port": "4444",
                "path": "/",
                "tmpfs": {
                    "/tmp": "size=128m"
                }
},
    "firefox": {
        "default": "60.0",
        "versions": {
            "50.0": {
                "image": "selenoid/firefox:50.0",
                "port": "4444",
                "path": "/wd/hub",
                "tmpfs": {
                    "/tmp": "size=128m"
                }
            },
            "60.0": {
                "image": "selenoid/firefox:60.0",
                "port": "4444",
                "path": "/wd/hub",
                "tmpfs": {
                    "/tmp": "size=128m"
        }
            }
        }
    },

在测试中我有以下代码:

capabilities = {
                "browserName": "chrome",
                "version": "60.0"
            }
            options = webdriver.ChromeOptions()
            options.add_argument('--ignore-certificate-errors')
            options.add_argument('--no-sandbox')
            self.driver = webdriver.Remote(
                command_executor="http://localhost:4444/wd/hub",
                desired_capabilities=capabilities, options=options)

问题:为什么我不能运行特定的浏览器版本? 它给了我例外:

WebDriverException: Message: Requested environment is not available

如果我没有在功能中指定版本,测试运行成功。

【问题讨论】:

    标签: python selenium selenoid


    【解决方案1】:

    正如我在 Github issue 和 AT forum 中所说的那样 - 您的配置和代码似乎是正确的。确保 Selenoid 使用了您的配置文件(重新启动其容器或执行 docker kill -s HUP selenoid)。如果这没有帮助 - 请注意 Selenoid 日志中的 ENVIRONMENT_NOT_AVAILABLE 消息,它们会指定哪个浏览器名称和版本事实上从您的测试中到达 Selenoid。

    【讨论】:

      猜你喜欢
      • 2017-11-06
      • 1970-01-01
      • 1970-01-01
      • 2014-02-11
      • 2012-05-30
      • 1970-01-01
      • 1970-01-01
      • 2014-09-06
      相关资源
      最近更新 更多