Re: [Wtr-general] Problem with running tests in a suite

2005-08-30 Thread Bret Pettichord

For IE Controller:

http://rubyforge.org/frs/shownotes.php?release_id=241

* Added fix for the RPC intermittent bug that would occur of an instance
  of ie/iec was created too soon after a previous one was killed.

Code change to def initialize():

# creating a new IE instance immediately after quiting a previous one
# causes intermittent RPC unavailable errors and other weirdness.
# Make sure to wait 1 second after eating before swimming...
until (Time.now - @@closed_last)  1; sleep 0.1; end if @@closed_last

immediate preceeds:

@ie = WIN32OLE.new('InternetExplorer.Application')

Any reason we shouldn't add this code to Watir?

-

I remember complaining about this problem to Chris Morris when i was just a 
user of his IE Controller. I think he fixed it. Someone want to check the 
history of that project. Chris?


Maybe the answer is to avoid shutting down the COM server until you are 
done running tests.


One way would be to reuse the same client with your tests. That is what we 
do with the Watir unit tests. Another would be create an invisible ie at 
the beginning and not shut it down in the end. If we have one client 
reference, closing other ie instances won't also shutdown the server.


Bret



_
 Bret Pettichord
 www.pettichord.com

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Problem with running tests in a suite

2005-08-25 Thread Andy Sipe

I have exactly the same problem. The problem is made worse when running on slower computers.The testsuite runs fine on higher speed development stations, but when run on a build box that is under considerable strain many of the tests written using watirfail with this problem. I haven't come up with any real good solution other than to sleep in teardown (which doesn't always work).
-andy




From:Owen Rogers [EMAIL PROTECTED]Reply-To:wtr-general@rubyforge.orgTo:wtr-general@rubyforge.orgSubject:Re: [Wtr-general] Problem with running tests in a suiteDate:Wed, 24 Aug 2005 20:00:35 -0400On 24/08/05, Jeff Wood [EMAIL PROTECTED] wrote: add a setup function to your test case to create a new instance for each test then, add a teardown function and force the browser to go away. ( ie.quit ) that should take care of things...actually, this doesn't quite work.ie.quit/close is an asynchronouscall to the ie com server.as a result, the new instance of ie thatyou create in your setup may connect to a com server that is in theprocess of shutting 
down.you can "fix" this with a sleep in yourteardown, but it's pretty ugly and unreliable.this is a big problemfor watir IHMO.i faced the same problem with a testing wrapper thati wrote for IE in C#.can't remember if i managed to fix it or not.cheers,owen.--Owen Rogers | http://dotnetjunkies.com/weblog/exortech |CruiseControl.NET - http://ccnet.thoughtworks.com___Wtr-general mailing listWtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Problem with running tests in a suite

2005-08-24 Thread Lisa Crispin
If we have really small scripts/test cases, they run fine in a suite. 
But as we add code to them, we start having a problem where the first
IE browser window does not shut down, and the second script errors out
because there was a window already open. As the scripts get larger,
this happens more consistently.

We're working around this by putting in sleeps, but that seems like a
hack and potentially unreliable.  What am I missing here?  One of my
Java programmer coworkers who knows some Ruby looked at it with me,
but couldn't come up with any other solution.

Here is what my suite looks like.  Maybe there's a better way to do the suite?

$:.push(../lib)
$:.push(../scripts/simple)

require 'test/unit'
require 'Payroll/tc_manage_groups'
require 'Payroll/tc_create_payroll'

thanks,
Lisa

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Problem with running tests in a suite

2005-08-24 Thread Jeff Wood
add a setup function to your test case to create a new instance for
each test then, add a teardown function and force the browser to go
away. ( ie.quit )

that should take care of things... 

On 8/24/05, Lisa Crispin [EMAIL PROTECTED] wrote:
 If we have really small scripts/test cases, they run fine in a suite.
 But as we add code to them, we start having a problem where the first
 IE browser window does not shut down, and the second script errors out
 because there was a window already open. As the scripts get larger,
 this happens more consistently.
 
 We're working around this by putting in sleeps, but that seems like a
 hack and potentially unreliable.  What am I missing here?  One of my
 Java programmer coworkers who knows some Ruby looked at it with me,
 but couldn't come up with any other solution.
 
 Here is what my suite looks like.  Maybe there's a better way to do the suite?
 
 $:.push(../lib)
 $:.push(../scripts/simple)
 
 require 'test/unit'
 require 'Payroll/tc_manage_groups'
 require 'Payroll/tc_create_payroll'
 
 thanks,
 Lisa
 
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 


-- 
So long, and thanks for all the fish

Jeff Wood

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Problem with running tests in a suite

2005-08-24 Thread Owen Rogers
On 24/08/05, Jeff Wood [EMAIL PROTECTED] wrote:
 add a setup function to your test case to create a new instance for
 each test then, add a teardown function and force the browser to go
 away. ( ie.quit )
 
 that should take care of things...

actually, this doesn't quite work.  ie.quit/close is an asynchronous
call to the ie com server.  as a result, the new instance of ie that
you create in your setup may connect to a com server that is in the
process of shutting down.  you can fix this with a sleep in your
teardown, but it's pretty ugly and unreliable.  this is a big problem
for watir IHMO.  i faced the same problem with a testing wrapper that
i wrote for IE in C#.  can't remember if i managed to fix it or not.
cheers,
owen.

-- 
Owen Rogers | http://dotnetjunkies.com/weblog/exortech |
CruiseControl.NET - http://ccnet.thoughtworks.com

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general