1
votes

I am fairly new to automation testing and was trying the following code.

While trying to load firefox browser by the following code

@browser = Watir::Browser.new :firefox
@browser.goto "https://www.linkedin.com/"

When(/^I enter username as (.*?)$/) do |username|
  @browser.element(:xpath => "//[@id='login-email']").set username
end
....
.... and so on

I am getting the following on the first browser load line.

undefined method col_span' for classWatir::TableCell' (NameError)

I am using Ruby (2.5), Cucumber(1.3.2), Watir(4.0.2) and Selenium-webdriver(2.53.4).

Any help would be great. Thanks

2

2 Answers

1
votes

As of Watir v6.7, attribute methods are now just the attribute name in lowercase. They are no longer using snake case.

In other words, you want to use colspan instead - eg:

browser.td.colspan
0
votes

Try to install only watir instead of watir-webdrive. Then you require watir. When calling the class, use Watir in camelcase. To me it worked this way when calling chromedriver.exe:

require 'watir'
browser = Watir::Browser.new