Eric MSP Veith wrote in post #1125861:
Without showing the exact code triggering the error, there is no way we
can help. Your variable and its contents are not special enough to show
an error per se:
2.0.0p247 :001 > a = ":name, btnk"
=> ":name, btnk"
2.0.0p247 :002 > puts a
:name, btnk
=> nil
Following is the content of my files:
File1.rb
require "rubygems"
require "watir"
class GoogleHomePage
attr_reader :shaik, :googlesearchbutton, :hindilinkclick,
:bengalilinkclick, :searchfield
def initialize()
puts "in INITIALIZE"
@googlesearchbutton = ":name, btnK"
end
···
-------------------------
File2.rb
require "rubygems"
require "watir"
#require 'watir-webdriver'
require 'rspec'
Given /^that I have gone to the (.+)$/ do |page_name|
puts "IN Given"
@@googlehomepageobject = GoogleHomePage.new() #Instance of class in
File1.rb
puts "------------ #{@@googlehomepageobject.googlesearchbutton}" #this
line prints the value of the variable as ":name, btnK"
@browser.button(@@googlehomepageobject.googlesearchbutton).wait_until_present
#tis line triggers the error "no implicit conversion of String into
Hash"
end
Thanks,
#M
--
Posted via http://www.ruby-forum.com/.