While accessing driver.manage.logs.get(:browser) on chromedriver 75.0.3770.8 - it cause error
undefined method `log' for # (NoMethodError)
Works fine on 74.0.3729.6
from: https://github.com/SeleniumHQ/selenium/issues/7270
WebDriver is an open source tool for automated testing of webapps across many browsers. It provides capabilities for navigating to web pages, user input, JavaScript execution, and more. ChromeDriver is a standalone server that implements the W3C WebDriver standard.
Chrome 75 defaults to W3C mode, which doesn't specify a way to get log access.
The short term fix for this issue is to disable w3c
via chromeOptions
.
Capybara.register_driver :headless_chrome do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: { args: %w[headless window-size=1280,800], w3c: false },
)
Capybara::Selenium::Driver.new app,
browser: :chrome,
desired_capabilities: capabilities
end
in recent selenium-webdriver
(4.4.0) with recent Chrome (105), manage.logs
is gone but this works:
page.driver.browser.logs.get(:browser)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With