Hi,
i have created 3 files 1.class.rb 2.class_test.rb 3.class.yml
class.rb i have created two files 1 class and other two functions
with diffrent names.
class_test.rb i have written 1 class and 2 functions.
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_details=>
[{“Test Suite failure to execute or initialize”=>
{:ci_pass=>false,
:duration=>0,
:description=>“undefined method `values’ for nil:NilClass”,
:test_info=>“Check message for exact error.”,
:message=>
“NoMethodError : undefined method values for nil NilClass”}}]}}
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
|file_name|
require ‘rubyXL’
require ‘roo’
workbook = Roo::Spreadsheet.open(file_name)
workbook1 = RubyXL::Parser.parse(file_name)
for j in (workbook.first_row…workbook.last_row)
for k in (workbook.first_column…workbook.last_column)
if(k==1)
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)) &&
workbook.last_column!=‘nil’)
print "---#{workbook.cell(j,k)} --exist--------\n"
worksheet1.sheet_data[j][k].change_fill ('008000')
end
end
end
end
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.