How to Use WATIR

S

Sudeep P.

Hi,

I am completely new to WATIR.
I have installed Ruby 1.9.2 and have also installed WATIR by the
command:

gem install watir

WATIR has been installed but I donot know how to write the WATIR scripts
and how to run them. Actually I know the syntax of writing it but do not
know where to write and how to save and run it. Like for HTML we write
it in Notepad and save with an extension name of .htm . The same way
please can you tell me the procedure for writing and executing a WATIR
script.


Thanks in advance,
Sudeep
 
M

Mike Stephens

The Watir site has a number of tutorials you need to read.

Write your script and save it with an .rb extension - it's a Ruby
program, or you can use the supplied editor Scite and press F5.
 
J

Josh Cheek

[Note: parts of this message were removed to make it a legal post.]

Hi,

I am completely new to WATIR.
I have installed Ruby 1.9.2 and have also installed WATIR by the
command:

gem install watir

WATIR has been installed but I donot know how to write the WATIR scripts
and how to run them. Actually I know the syntax of writing it but do not
know where to write and how to save and run it. Like for HTML we write
it in Notepad and save with an extension name of .htm . The same way
please can you tell me the procedure for writing and executing a WATIR
script.


Thanks in advance,
Sudeep
1. Save it in a text file, like query_google.rb (or whatever yours does)

2. Open up a terminal. On Mac, you can type "Terminal" into the spotlight,
and it will locate the application for you. On Windows, Click the start bar,
then click run, then type in "cmd" (If you're on Windows 7, you have
something called the power shell that is worth looking into)

3. Navigate to the directory you saved it in (use "cd mydir" to change to
the "mydir" directory -- directory is nerdspeak for folder -- on windows,
these commands might be different)

4. Type "ruby query_google.rb"
 

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,262
Messages
2,571,044
Members
48,769
Latest member
Clifft

Latest Threads

Top