我正在尝试设置我的selenium测试套件以使用Firefox,我正在使用selenoid来对接浏览器以进行测试。据我所知,我做的一切都是正确的,但我得到了一个InvalidArgumentException。
这里是我定义webdriver.Remote的地方:
firefox_caps = {
"browserName": "firefox",
"browserVersion": "97.0",
"selenoid:options": {
"enableVNC": True,
"enableVideo": False
}
}
cls.driver = webdriver.Remote(command_executor="http://localhost:4444/wd/hub", desired_capabilities=firefox_caps)下面是selenoid使用的我的browsers.json文件的内容:
{
"chrome": {
"default": "88.0",
"versions": {
"88.0": {
"image": "selenoid/vnc_chrome:88.0",
"port": "4444",
"path": "/",
"env": ["TZ=America/Denver"]
}
}
},
"firefox": {
"default": "97.0",
"versions": {
"97.0": {
"image": "selenoid/vnc_firefox:97.0",
"port": "4444",
"path": "/"}
}
}
}下面是我在测试中获得的错误信息:
Traceback (most recent call last):
File "/Users/ryannygard/selenium/extensions/test_suite.py", line 38, in _handleClassSetUp
setUpDomain(self.env)
File "/Users/ryannygard/selenium/automation/core/tests/base.py", line 146, in setUpDomain
cls.driver = webdriver.Remote(command_executor="http://localhost:4444/wd/hub", desired_capabilities=firefox_caps, browser_profile=FirefoxProfile())
File "/Users/ryannygard/.local/share/virtualenvs/selenium-8l3DWFXO/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/Users/ryannygard/.local/share/virtualenvs/selenium-8l3DWFXO/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/Users/ryannygard/.local/share/virtualenvs/selenium-8l3DWFXO/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/Users/ryannygard/.local/share/virtualenvs/selenium-8l3DWFXO/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: Requested environment is not available发布于 2022-05-22 06:56:35
对于火狐图片,路径应该是/wd/hub。
https://stackoverflow.com/questions/72313813
复制相似问题