Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rb/lib/selenium/webdriver/bidi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def send_cmd(method, **params)
raise Error::WebDriverError, error_message(message) if message['error']

message['result']
rescue StandardError => e
raise e, "Unable to send command #{method}: #{e.message}"
end

def error_message(message)
Expand Down
13 changes: 7 additions & 6 deletions rb/lib/selenium/webdriver/common/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ def clear_handlers
end

def add_authentication_handler(username = nil, password = nil, *filter, pattern_type: nil, &block)
selected_block =
if username && password
proc { |auth| auth.authenticate(username, password) }
else
block
end
selected_block = if block_given?
block
elsif !(username && password)
raise ArgumentError, 'Need to provide either a block or both username and password'
else
proc { |auth| auth.authenticate(username, password) }
end

add_handler(
:auth_required,
Expand Down
Loading