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
[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
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
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' =
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
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
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
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).
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,