Selenium 4.0 Alpha 6 Release- Added support for Chrome DevTools protocol!

Share This Post -
SeleniumHQ has release 4.0 Alpha 6 on 2020-05-28. Awesome contributors have added the support for Chrome DevTools Protocol!

We would like to thank them for making our life easy.

Key changes include:
  • Full remoting of the CDP protocol across the Grid
  • The skeleton of our GraphQL support
  • Better configuration options, especially for Nodes, via TOML
  • A bajillion improvements & fixes



Chrome:
1. Added DevTools classes and methods generated from the CDP specification. It currently supports commands and events and provides Rubyish API:
      driver.devtools.page.navigate(url: 'http://google.com')
      driver.devtools.console.clear_messages
      driver.devtools.page.enable
      driver.devtools.page.on(:load_event_fired) do |params|
        puts("Page loaded in #{params['timestamp']}")
      end
Check https://chromedevtools.github.io/devtools-protocol/ for more information about possible commands and events. Please note that this API is considered to be experimental and may change any time before stable 4.0 release.

2. Fixed an issue when passing :prompt_for_download (or similar snake_cased
    symbols) in Options#prefs would be ignored by Chrome because Selenium
    would internally convert it to camelCased format (:promptForDownload).
    Now :prefs are left intact.

Edge:
1. Fixed an issue when Driver#execute_cdp would not work for Chromium-based Edge browser.

Ruby:
1. Deprecated passing :desired_capabilities and :options to driver initialization in favor of :capabilities. They now can be combined in an array to make custom capabilities requirements:

      caps = Selenium::WebDriver::Remote::Capabilities.chrome
      opts = Selenium::WebDriver::Chrome::Options.new
      Selenium::WebDriver.for(:remote, capabilities: :chrome)
      Selenium::WebDriver.for(:remote, capabilities: caps)
      Selenium::WebDriver.for(:remote, capabilities: opts)
      Selenium::WebDriver.for(:remote, capabilities: [caps, opts])

2. Deprecated passing Hash to :capabilities in favor of Remote::Capabilities object.
3. Updated minimum require Ruby version to 2.5.
4. Improved keyword arguments handling to avoid warnings in Ruby 2.7.