-
Notifications
You must be signed in to change notification settings - Fork 1.4k
-
Hello!
It is not possible to launch a specific browser and version in selenoid
When choosing to launch via --browser=remote, the parameters browserName, browserVersion do not lend themselves to capability.
You need to specify the browser opera, chrome, firefox and versions for them
Or am I doing something wrong? Thanks!
example capability:
config['capabilities'] = {
"browserName": "chrome",
"browserVersion": "96.0",
"goog:chromeOptions": {
"args": [
"window-size=1920,1080"
]
},
"selenoid:options": {
"enableVNC": True,
"enableVideo": False,
"enableLog": True,
"screenResolution": screen_resolution,
}
}
Beta Was this translation helpful? Give feedback.
All reactions
Hello, the capabilities depend on the type of Selenium Grid being used. For some grids, the browser is specified inside capabilities, and for other grids (as well as non-grid tests) the browser is specified using --browser=BROWSER
. The capabilities you have seem to match the format of a capabilities file (example: selenoid_cap_file.py) although if you are trying to specify an exact browser version, then the Grid would need to have that version installed. Otherwise it'll just use the version that it finds. More info on capabilities usage here: https://github.com/seleniumbase/SeleniumBase/tree/master/examples/capabilities
Replies: 1 comment 4 replies
-
Hello, the capabilities depend on the type of Selenium Grid being used. For some grids, the browser is specified inside capabilities, and for other grids (as well as non-grid tests) the browser is specified using --browser=BROWSER
. The capabilities you have seem to match the format of a capabilities file (example: selenoid_cap_file.py) although if you are trying to specify an exact browser version, then the Grid would need to have that version installed. Otherwise it'll just use the version that it finds. More info on capabilities usage here: https://github.com/seleniumbase/SeleniumBase/tree/master/examples/capabilities
Beta Was this translation helpful? Give feedback.
All reactions
-
Version selection only works for chrome. It would be desirable that for remote it was also possible to forward the version and the browser. Although you can opera and firefox
remote, opera:
elif browser_name == constants.Browser.REMOTE:
selenoid = False
selenoid_options = None
screen_resolution = None
for key in desired_caps.keys():
if key == "selenoid:options":
selenoid = True
selenoid_options = desired_caps[key]
elif key == "screenResolution":
screen_resolution = desired_caps[key]
if selenium4:
remote_options = ArgOptions()
remote_options.set_capability("cloud:options", desired_caps)
if selenoid:
snops = selenoid_options
remote_options.set_capability("selenoid:options", snops)
if screen_resolution:
scres = screen_resolution
remote_options.set_capability("screenResolution", scres)
return webdriver.Remote(
command_executor=address,
options=remote_options,
keep_alive=True,
)
Chrome:
for key in desired_caps.keys():
capabilities[key] = desired_caps[key]
if key == "selenoid:options":
selenoid = True
selenoid_options = desired_caps[key]
elif key == "screenResolution":
screen_resolution = desired_caps[key]
elif key == "version" or key == "browserVersion":
browser_version = desired_caps[key]
elif key == "platform" or key == "platformName":
platform_name = desired_caps[key]
if selenium4:
chrome_options.set_capability("cloud:options", capabilities)
if selenoid:
snops = selenoid_options
chrome_options.set_capability("selenoid:options", snops)
if screen_resolution:
scres = screen_resolution
chrome_options.set_capability("screenResolution", scres)
if browser_version:
br_vers = browser_version
chrome_options.set_capability("browserVersion", br_vers)
if platform_name:
plat_name = platform_name
chrome_options.set_capability("platformName", plat_name)
return webdriver.Remote(
command_executor=address,
options=chrome_options,
keep_alive=True,
)
Beta Was this translation helpful? Give feedback.
All reactions
-
I see the issue. I'll try to ship a new release on Monday.
Beta Was this translation helpful? Give feedback.
All reactions
-
thanks!
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.