123456789_123456789_123456789_123456789_123456789_

Module: Selenium::DevTools

Constant Summary

Class Attribute Summary

Class Method Summary

Class Attribute Details

.version (rw)

[ GitHub ]

  
# File 'rb/lib/selenium/devtools.rb', line 23

attr_accessor :version

Class Method Details

.load_old_version(version) (private)

[ GitHub ]

  
# File 'rb/lib/selenium/devtools.rb', line 47

def load_old_version(version)
  require "selenium/devtools/v#{version}"
  self.version = version
  msg = "Using selenium-devtools version v#{version}, some features may not work as expected."
  WebDriver.logger.warn msg, id: :devtools
end

.load_older_version (private)

Try to load up to 2 versions back

[ GitHub ]

  
# File 'rb/lib/selenium/devtools.rb', line 36

def load_older_version
  load_old_version(@version - 1)
rescue LoadError
  begin
    load_old_version(@version - 2)
  rescue LoadError
    raise WebDriver::Error::WebDriverError,
          'Could not find a valid devtools version; use a more recent version of selenium-devtools gem'
  end
end

.load_version

[ GitHub ]

  
# File 'rb/lib/selenium/devtools.rb', line 25

def load_version
  require "selenium/devtools/v#{@version}"
rescue LoadError
  WebDriver.logger.warn "Could not load selenium-devtools v#{@version}. Trying older versions.",
                        id: :devtools
  load_older_version
end