[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Running [Watir] Tests With the Browser Not Visible

Phlip

9/10/2006 4:24:00 AM

Rubies:

Unit tests should run as silent, fast, and unattended as possible. Even sick
GUI tests.

So the page http://wtr.rubyforge.org/watir_user_... contains this
interesting line:

'Run the tests with a "-b" option if you don't want the browser to be
visible. ex. myTest.rb -b'

Imagine my naivete, typing a -b onto the end of the command line invoking my
test batch (using the standard Unit Test stuff under AutoRunner). The
browsers still pop up.

How to suppress them from within the code?

--
Phlip
http://www.greencheese.u... <-- NOT a blog!!!


2 Answers

bpettichord

9/10/2006 5:34:00 AM

0

The -b will work IF you require watir first:

require 'watir'
require 'test/unit'

Otherwise, test/unit will steal the arguments and not let watir have
them.

Or, after the requires, do
$HIDE_IE = true

Bret


Phlip

9/10/2006 7:23:00 PM

0

bpettichord wrote:

> Or, after the requires, do
> $HIDE_IE = true

It turns out this sets the wie.ie.Visible flag. So it's the same as I had
doing that. The window flashes as it paints, then hides itself.

This effect happens with both the in-process COM server and the with
IE.new_process() (which is otherwise working great; thanks!)

I thought that COM had a flag to pass into the object-creation muck to never
display the window. And I know that CreateProcess[Ex], the heart of
out-of-process creation, has one too.

--
Phlip
http://www.greencheese.u... <-- NOT a blog!!!