Hi Durgesh,

Try with this change

xlFile = XLS.new(Dir.pwd + '../Data.xls')

Thanks


On Thu, Aug 20, 2009 at 4:05 PM, KK <krishna.sara...@gmail.com> wrote:

>
> This might be because the Xls.rb is not accessible to this script. Try
> keeping the file in the same directory as your script is residing or
> provide the absolute path for the Xls.rb in the require statement.
>
> Thanks & Regards,
> KK
>
> On Jul 10, 5:24 pm, Durgesh Nadkarni <durgeshnadka...@gmail.com>
> wrote:
> > Hi,
> >
> > I have installed the ruby 1.8.6 and WATIR 1.6.2.
> >
> > I have created a script which fetches the data from excel sheet & perform
> > the operations.
> >
> > Then I have kept the following code in a common file inside 'Library'
> > directory which gets data from excel sheet.
> >
> > ----------------------------
> > require 'Xls' # Xls.rb is in the same directory(Library)
> > # This function is used to fetch the data from excelsheet.
> > def getdata()
> >   xlFile = XLS.new(Dir.pwd + '../Test-Data/Data.xls') #grab the data file
> >   mydata = xlFile.getRowRecords('Test Data','Sheet1')  #pull data records
> > from excel
> >   return mydata
> >   xlFile.close
> > end
> > ----------------------------
> >
> > All the functions related to excel operations are kept Xls.rb file which
> is
> > in same directory.Then I am calling the function getdata() from another
> file
> > from parent directory as below.
> >
> > ----------------------------------------
> > require 'test/unit'
> > require 'Library/common'
> > require 'watir'
> > Watir.options_file = 'E:/Data316/RSC-ePlatform/Automation/options.yml'
> >
> > class Gmail < Test::Unit::TestCase
> >  def test_Gmail_Working
> >
> >   # Calling getdata function
> >   @myData = getdata()
> >  end
> > end
> > ------------------------------------
> >
> > But when I ran the above script I got following error.
> >
> > ----------------------------------------
> > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> > `gem_original_require': no
> >
> > such file to load -- Xls (LoadError)
> >     from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> > `require'
> >     from ./Library/common.rb:5
> >     from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> >
> > 'gem_original_require'
> >     from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> > `require'
> >     from ESR6.rb:7
> > ---------------------------------------
> >
> > Please help me on the above issue.
> >
> > Thanks & Regards
> > Durgesh.
> >
>


-- 
Regards,
P.Raveendran
http://raveendran.wordpress.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to