我有以下配置文件 browsers.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
如果我没有在功能中指定版本,则测试会成功运行。