Module: SeleniumMonkeypatch::InstanceMethods

Defined in:
lib/birdsong/monkeypatch.rb

Instance Method Summary collapse

Instance Method Details

#send_cmd(method, **params) ⇒ Object

We’re monkeypatching the following method so that Selenium doesn’t raise errors when we fail to call ‘continue` on requests



39
40
41
42
43
44
45
46
47
48
# File 'lib/birdsong/monkeypatch.rb', line 39

def send_cmd(method, **params)
  data = { method: method, params: params.compact }
  data[:sessionId] = @session_id if @session_id
  message = @ws.send_cmd(**data)
  if message.nil? == false && message["error"] && (method != "Fetch.continueRequest")
    raise Selenium::WebDriver::Error::WebDriverError, error_message(message["error"])
  end

  message
end