[wtr-general] Re: How do i read a .txt file using watir script

2014-01-10 Thread Priti Fhuse
1In which dir i suppose to save txt file 2getting error for require 'watir' file=File.new(e:\result.txt,r) file.puts Now, write #{i} file.close =error esult.txt (Errno::EINVAL)Invalid argument - e: from 11.rb:3:in `new' from 11.rb:3:in `main' On

Re: [wtr-general] Re: How do i read a .txt file using watir script

2014-01-10 Thread John Fitisoff
[1] pry(main) f = File.new('foo.txt', 'w+') #Change the r in the second argument because you need to write to the file. = #File:foo.txt [2] pry(main) f.puts 'dsfdsfs' = nil [3] pry(main) f.close = nil [4] pry(main) File.read 'foo.txt' = dsfdsfs\n [6] pry(main) puts e:\result.txt #You have to be

[wtr-general] Re: How do i read a .txt file using watir script

2014-01-10 Thread Super Kevy
hint Google Ruby Class file http://www.ruby-doc.org/core-2.0.0/File.html On Monday, September 14, 2009 5:36:50 AM UTC-5, msazeez28july wrote: Hi, We have watir scripts which requires url, username, password and path (location of the datatables). These parameters are

[wtr-general] Re: How do i read a .txt file using watir script

2014-01-10 Thread Super Kevy
Seems like a lot of overhead reading and parsing a file that way. Look at http://roo.rubyforge.org/ the Roo gem. I believe you'll find useage and hints in this list somewhere. You may want to rethink into using Ruby Class Hash for this as well. myParams = { 'url' =

[wtr-general] Re: How do i read a .txt file using watir script

2009-09-20 Thread crsna
were you able to find a solution? On Sep 14, 6:36 am, msazeez28july sabdulkha...@gmail.com wrote: Hi,       We have watir scripts which requires url, username, password and path (location of the datatables).       These parameters are changing depends upon the server where application is

[wtr-general] Re: How do i read a .txt file using watir script

2009-09-20 Thread karim rayani
like said begin file = File.new(readfile.txt, r) while (line = file.gets) puts #{counter}: #{line} counter = counter + 1 end file.close rescue = err puts Exception: #{err} err end the above script reads your readfile.txt line by line, the string

[wtr-general] Re: How do i read a .txt file using watir script

2009-09-14 Thread karim rayani
begin file = File.new(readfile.rb, r) while (line = file.gets) puts #{counter}: #{line} counter = counter + 1 end file.close rescue = err puts Exception: #{err} err end readfile.rb is your .txt file and line is data from each line in the

[wtr-general] Re: How do i read a .txt file using watir script

2009-09-14 Thread Raveendran P
Hi, If you interested in your requirement then try this -- http://www.yaml.org/YAML_for_ruby.html On Mon, Sep 14, 2009 at 4:06 PM, msazeez28july sabdulkha...@gmail.comwrote: Hi, We have watir scripts which requires url, username, password and path (location of the datatables).

[wtr-general] Re: How do i read a .txt file using watir script

2009-09-14 Thread kiran yajamanyam
Why dont your try .ini file, you keep all the required SN and Password information in .ini file and access it through your script. This will be simple I feel Kiran On Mon, Sep 14, 2009 at 4:06 PM, msazeez28july sabdulkha...@gmail.comwrote: Hi, We have watir scripts which requires url,