How to write in a Text file

H

Hasmukh K P

I am very new to Ruby. I have written some test case for my Web
application. I need to log the information of my Testcase results in
Text file.
I tried Log, but couldn't succeed.
Can anyone tell me, how can I do this !!

Hasmukh
 
D

Dave Burt

Hasmukh K P said:
I am very new to Ruby. I have written some test case for my Web
application. I need to log the information of my Testcase results in Text
file.
I tried Log, but couldn't succeed.
Can anyone tell me, how can I do this !!

That depends on what test framework you are using. Most should have logging
capability of some sort. If they just output to STDOUT, you can redirect
that output to a file from your shell, probably something like this:

run_tests.rb > log_file.txt

Also, if you are doing web testing and haven't seen Watir, you should check
it out. Here's a nice document walking through a basic test:

http://www.kohl.ca/articles/watir_works.pdf

And here's Watir:

http://wtr.rubyforge.org/

Cheers,
Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,172
Messages
2,570,934
Members
47,478
Latest member
ReginaldVi

Latest Threads

Top