How to Use WATIR

Discussion in 'Ruby' started by Sudeep P., Nov 18, 2010.

  1. Sudeep P.

    Sudeep P. Guest

    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

    --
    Posted via http://www.ruby-forum.com/.
     
    Sudeep P., Nov 18, 2010
    #1
    1. Advertising

  2. 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.

    --
    Posted via http://www.ruby-forum.com/.
     
    Mike Stephens, Nov 18, 2010
    #2
    1. Advertising

  3. Sudeep P.

    Josh Cheek Guest

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

    On Thu, Nov 18, 2010 at 12:52 AM, Sudeep P. <>wrote:

    > 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
    >
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >

    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"
     
    Josh Cheek, Nov 18, 2010
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bret Pettichord

    Watir needs a Win32GUI library

    Bret Pettichord, Mar 12, 2005, in forum: Ruby
    Replies:
    0
    Views:
    133
    Bret Pettichord
    Mar 12, 2005
  2. Espen Falkevik

    Watir, XML,

    Espen Falkevik, Jun 16, 2005, in forum: Ruby
    Replies:
    3
    Views:
    268
    James Britt
    Jun 17, 2005
  3. watir and iframes?

    , Jul 7, 2005, in forum: Ruby
    Replies:
    3
    Views:
    424
  4. Bret Pettichord

    Watir attracts Ruby Newbies

    Bret Pettichord, Aug 30, 2005, in forum: Ruby
    Replies:
    9
    Views:
    178
    David Brady
    Sep 1, 2005
  5. Anukul Singhal
    Replies:
    1
    Views:
    182
    Charley Baker
    May 15, 2008
Loading...

Share This Page