Attempting to parameterize the View Detail index value for the puppy adoption site

28 views
Skip to first unread message

Alex Sombaty

unread,
Jul 19, 2015, 1:20:15 PM7/19/15
to cucumber-...@googlegroups.com
Hello All,
I am new to Ruby/Cucumber and I am trying to iterate through the puppy adoption process and selelct a different View Detail button for each iteration.  When I add the code, my tests are failing because the script see the View Detail button as a number.  Here's the code I wrote to attempt this.  Any ideas?

def adopt_puppy_number(num)
@browser.button(:value => 'View Details', :index => num - 1).click
end

When(/^I click the "([^"]*)" button$/) do |num|
adopt_puppy_number(num)
end

Carlito GZ

unread,
Aug 12, 2015, 9:42:54 AM8/12/15
to Cucumber and Cheese
What error did you get generated in the console/cmd prompt?
Reply all
Reply to author
Forward
0 new messages