-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Open
Labels
A-needs-triagingA Selenium member will evaluate this soon!A Selenium member will evaluate this soon!C-rbRuby BindingsRuby BindingsD-chromeI-defectSomething is not working as intendedSomething is not working as intendedOS-linux
Description
Description
I'm trying to set unhandledPromptBehavior
to the hash { 'default' => 'ignore' }
. This throws a Selenium::WebDriver::Error::InvalidArgumentError
with the message
invalid argument: cannot parse capability: unhandledPromptBehavior
from invalid argument: Unexpected value {\"default\" => \"ignore\"} in capabilities
The culprit seems to be in lib/selenium/webdriver/common/options.rb:134
, where the :unhandled_prompt_behavior
key is converted to a string (most likely to convert :accept_and_ignore
to "accept and ignore"
). This makes it impossible to pass a hash to the browser.
Without that line, the browser accepts the hash argument and handles alerts as expected.
Reproducible Code
require 'selenium-webdriver'
options = Selenium::WebDriver::Chrome::Options.new
options.add_option(:unhandled_prompt_behavior, { 'default' => 'ignore' })
driver = Selenium::WebDriver.for :chrome, options: options # This raises the error
driver.quit
Metadata
Metadata
Assignees
Labels
A-needs-triagingA Selenium member will evaluate this soon!A Selenium member will evaluate this soon!C-rbRuby BindingsRuby BindingsD-chromeI-defectSomething is not working as intendedSomething is not working as intendedOS-linux