Ruby cucumber automation suite - parameter received as null while iterating

by apprentice_RR   Last Updated March 19, 2016 08:02 AM

I inherited a test automation suite and while modifying it I am trying to write a function to test similar links which are present in the same web page but in different divs and the tag ids are dynamic

I have a function defined below which accepts an HTML element and sends an action to the element

def element_do(html_element, html_element_type, html_element_value, action)
@browser.send(html_element.to_sym, html_element_type.to_sym, html_element_value).send(action)

I have a method defined as somemethod and I am trying to call the method in a particular div using the some_element#{i} as below

def multiple_accounts
@num_accts.each do |i|
    p "validating for account #{i}"

The issue I am facing is that on second iteration the action parameter is passed as "null" instead of the somemethod. I am new to ruby automation and I am not sure what exactly is happening. Any help is appreciated

Related Questions

Automated testing - xebium and fitnesse

Updated July 23, 2015 14:02 PM

What is the coolest Automated testing you have done?

Updated August 08, 2018 14:05 PM