passing parameter to WATIR through command line

Discussion in 'Ruby' started by curious, Oct 29, 2006.

  1. curious

    curious Guest

    I have below code that beautifully calls RUBY, WATIR code through
    Microsoft Access.
    ----------------------------------------------------------------------------------------------------------------------------------
    Private Sub Command2_Click()
    Call Shell(Environ$("COMSPEC") & " /c c:\Watir\search.rb",
    vbNormalFocus)
    End Sub
    -----------------------------------------------------------------------------------------------------------------------------------

    I think it will be much more beautiful if I can pass down values in the
    field in Access record to this code.

    For instance, when the WATIR code is as below:
    ------------------------------------------------------------------------------
    require 'watir'

    ie = Watir::IE.start("http://www.test.php")

    $parameter = "field_1"

    ie.text_field:)name, "search").value = $parameter

    ie.button:)value, "Submit").click

    ------------------------------------------------------------------------------
    if the value in "field_1" can be picked from current record field in MS
    Access, then I can search through this web site by choosing a value in
    the list of records in Access, and click command button that will call
    WATIR with parameter passed through the choice I made in Access
    records..

    Could anyone tell me how I can pass down parameter values in Ruby
    through the command line??

    I took care of calling ruby from Access.. and it will be so good if I
    can call this Ruby from Access with whatever value I choose in Access
    record that will be used in Ruby, WATIR..

    Thanks..
    curious, Oct 29, 2006
    #1
    1. Advertising

  2. curious

    Guest

    You can also try SWExplorerAutomation SWEA (http://webunittesting.com).
    You can access SWEA API directly from the Access code.

    curious wrote:
    > I have below code that beautifully calls RUBY, WATIR code through
    > Microsoft Access.
    > ----------------------------------------------------------------------------------------------------------------------------------
    > Private Sub Command2_Click()
    > Call Shell(Environ$("COMSPEC") & " /c c:\Watir\search.rb",
    > vbNormalFocus)
    > End Sub
    > -----------------------------------------------------------------------------------------------------------------------------------
    >
    > I think it will be much more beautiful if I can pass down values in the
    > field in Access record to this code.
    >
    > For instance, when the WATIR code is as below:
    > ------------------------------------------------------------------------------
    > require 'watir'
    >
    > ie = Watir::IE.start("http://www.test.php")
    >
    > $parameter = "field_1"
    >
    > ie.text_field:)name, "search").value = $parameter
    >
    > ie.button:)value, "Submit").click
    >
    > ------------------------------------------------------------------------------
    > if the value in "field_1" can be picked from current record field in MS
    > Access, then I can search through this web site by choosing a value in
    > the list of records in Access, and click command button that will call
    > WATIR with parameter passed through the choice I made in Access
    > records..
    >
    > Could anyone tell me how I can pass down parameter values in Ruby
    > through the command line??
    >
    > I took care of calling ruby from Access.. and it will be so good if I
    > can call this Ruby from Access with whatever value I choose in Access
    > record that will be used in Ruby, WATIR..
    >
    > Thanks..
    , Oct 29, 2006
    #2
    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. Mister B
    Replies:
    8
    Views:
    528
    Nick Keighley
    Aug 26, 2010
  2. michael
    Replies:
    3
    Views:
    147
    Chris McMahon
    Oct 24, 2006
  3. curious
    Replies:
    1
    Views:
    164
    Patrick Spence
    Oct 25, 2006
  4. Anukul Singhal
    Replies:
    1
    Views:
    157
    Charley Baker
    May 15, 2008
  5. soren625
    Replies:
    10
    Views:
    228
    Kevin Collins
    Dec 28, 2005
Loading...

Share This Page