Friday 23 August 2013

Capybara/ Ruby TypeError: can't convert String into Integer

Capybara/ Ruby TypeError: can't convert String into Integer

Recently we upgraded chrome to Version 29.0.1547.57 on our testing machine
we use for cucumber/selenium testing. Our previous selenium driver didn't
appreciate this, and all our tests started failing. when we updated to the
new selenium web driver for chrome(2.2), we started seeing failures on
only a few tests, all with one of the following two Two of the following
errors:
TypeError: can't convert String into Integer
I found the problem is coming from the second line of this snippet, which
is in our helpers.rb.
def use_admin_page_controls(selector)
while find(selector).has_link?('Next')
within(selector) do
click_link('Next')
sleep 0.25
end
end
within(selector) do
click_link('Prev')
click_link('First')
end
end
NoMethodError: undefined method `downcase' for # is the other error,
coming from the following snippet on line 7 :
`When /^I edit the alert name for (.*) and change to (.*)$/ do |name, rename|
click_link_or_button('Clear Form')
page.should have_content('No people criteria have been selected.')
find('#topNavContainer').click_link_or_button('Alerts')
click_link_or_button(name)
find('.selectedItem').find('.editItem').click
fill_in('alertName', :with => rename)
click_link_or_button('editAlertButton')
end`
I am fairly new to cucumber/Ruby and digging through the code to find the
root cause isn't proving very fruitful for me. i am working under the
assumption that changing the driver was involved somehow as this did not
occur with the previous version.

No comments:

Post a Comment