# Passing parameter to WATIR through command line

**URL:** <https://www.ruby-forum.com/t/passing-parameter-to-watir-through-command-line/74049>\
**Category:** Ruby\
**Created:** [October 29, 2006, 2:56pm UTC](https://www.ruby-forum.com/t/passing-parameter-to-watir-through-command-line/74049 "2006-10-29T14:56:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![curious](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6bbea6/32.png) [@curious](https://www.ruby-forum.com/u/curious)\
**Post date:** [October 29, 2006, 2:56pm UTC](https://www.ruby-forum.com/t/passing-parameter-to-watir-through-command-line/74049/1 "2006-10-29T14:56:50Z")

</div>

## 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](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…

---

<div class="post-metadata">

**Author:** ![curious](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6bbea6/32.png) [@curious](https://www.ruby-forum.com/u/curious)\
**Post date:** [October 29, 2006, 8:03pm UTC](https://www.ruby-forum.com/t/passing-parameter-to-watir-through-command-line/74049/2 "2006-10-29T20:03:38Z")

</div>

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