-
Notifications
You must be signed in to change notification settings - Fork 8
add 4. selenium version to get compatibility with Selenium Grid 4. #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I think this code can be simplified. It looks like def build_chrome_driver(chrome_ops)
chromeOptions = Selenium::WebDriver::Chrome::Options.new(
options: chrome_ops,
)
if @url.nil?
# local selenium instance
driver = Selenium::WebDriver.for(
:chrome, options: chromeOptions,
)
else
# remote selenium grid
log_debug("Selenium Server URL: #{@url}")
driver = Selenium::WebDriver.for(
:remote, url: @url, options: chromeOptions,
)
end
return driver
endThe equivalent code for other browsers should be similarly adjusted. |
I've modified it to cover that, the only one that Im not sure how to test is Safari, it doesnt seem to have any capabilities that I can try and work with... but for the rest of the browsers, everything goes as expected |
|
Ok great - I can check it once you push the commit :) |
done |
TDL-EdgarsEglitis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only use Selenium::WebDriver::<browser>::Options.new
|
I just realised that the code can be simplified even further: def build_chrome_driver(chrome_ops)
chromeOptions = Selenium::WebDriver::Chrome::Options.new(
options: chrome_ops,
)
if @url.nil?
# local selenium instance
Selenium::WebDriver.for(
:chrome, options: chromeOptions,
)
else
build_remote_driver(chromeOptions)
end
end
# similar methods for other browser drivers
def build_remote_driver(options)
# remote selenium grid
log_debug("Selenium Server URL: #{@url}")
Selenium::WebDriver.for(
:remote, url: @url, options: options,
)
end |
Yes, this makes a lot of sense, thanks! |
Right now, using selenium grid 4.14.1 Testray doesnt work, adding this upgrade will make it work.