"NoMethodError : undefined method values for nil NilClass"}

i have created 3 files 1.class.rb 2.class_test.rb 3.class.yml

  1. class.rb i have created two files 1 class and other two functions
    with diffrent names.
  2. class_test.rb i have written 1 class and 2 functions.
  3. class.yml in this i have callled 1 class and 2 functions

but m able to run only one function not second function.
m getting this error.
[{“Test Suite failure to execute or initialize”=>
:description=>“undefined method `values’ for nil:NilClass”,
:test_info=>“Check message for exact error.”,
“NoMethodError : undefined method values for nil NilClass”}}]}}

Did u get an answer for the above?
I too face the same issue

Riya Uma wrote in post #1181112:

Did u get an answer for the above?
I too face the same issue

What problem exactly? If you provide some code that could help us to
help you. Same for post above.

Hi This is my ruby -cucumber statement. I face the issue nil:Nil
class[]. When i try to debug , i found the ‘For’ iteration is searching
beyond the last column that does not have any content . But Im not able
to rectify it. please advise

Then /^I read the links from excel file “([^”]*)" and compare names$/ do
require ‘rubyXL’
require ‘roo’
workbook = Roo::Spreadsheet.open(file_name)
workbook1 = RubyXL::Parser.parse(file_name)

workbook.default_sheet=‘Left Navigation’
worksheet1 = workbook1[‘Left Navigation’]

for j in (workbook.first_row…workbook.last_row)
for k in (workbook.first_column…workbook.last_column)
choose(“lookupSearch”, :option => “Plan”)
fill_in “searchInput”, :with => workbook.cell(j,k)
find(:xpath, ‘//*[@id=“searchicon”]’).click

 elsif (page.has_content?(workbook.cell(j,k)) &&


  print "---#{workbook.cell(j,k)} --exist--------\n"
    worksheet1.sheet_data[j][k].change_fill ('008000')