Here are several use-cases this command would support:
script.rb:
goto('
http://www.google.com')
text_field(:name, 'q').set 'ruby'
button(:name, 'btnG').click
Execute it with:
> watir script.rb
Or rename at script.wtr, and create a file association:
> script.wtr
Scripts can also be specified on the command line:
> watir -e "goto('
http://www.google.com'); text_field(:name, 'q').set 'ruby'; button(:name, 'btnG').click"
Support -b switch to run invisibly
Automatic Browser Close
Consider adding an option to automatically close a script (no matter what) at the end.
* Need to do this automatically anyway if the window is not visible.
* But never auto close if we attached