Search code examples
rubycucumberwatirbrowserstack

Issue with - uninitialized constant WebDriver (NameError)


Hello and thanks in advance ...

I am trying to start browserstack and I am getting the following error:

 uninitialized constant WebDriver (NameError)

I am not sure how to resolve this... My Code is below:

require 'rubygems'
require 'watir-webdriver'

include Selenium

caps = WebDriver::Remote::Capabilities.new
caps[:os] = "Windows"
caps[:name] = "Watir WebDriver"
caps[:browser] = "firefox"
caps[:browser_version] = "50"
caps["browserstack.debug"] = "true"

browser = Watir::Browser.new(:remote,
                             :url => "xxx",
                             :desired_capabilities => caps)

Solution

  • watir-webdriver is deprecated, please install the latest version of WATIR, and then require 'watir'. WATIR is using selenium-webdriver inside now.