Hi, Bret...Would a script that opened and closed browsers repeatedly be expected to expose this? I wrote something like Marco's thing
No. This is a different issue. In both cases you are getting RPC errors. I was not able to reproduce this using your script, but i do remember seeing it with other scripts.
Although this occurs with 1.4.1, i do believe that we have this fixed in head. Would you mind checking. (BTW, you may want to use a smaller count, i ran your script on my machine and it unfortunately did not fail, but instead run until my battery ran out...)
Bret
def startBrowser()
ie = Watir::IE.new
ie.goto('http://192.168.1.100')
ie.bring_to_front()
ie.maximize()
ie.close
end10000.times {
startBrowser()
}The site address above is, obviously, an IIS server on my own net.I got these two errors on subsequent runs...C:\Documents and Settings\Michael Bolton\My Documents\Ruby Scripts>zillion.rb
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `method_missing': Unknown property or method `document' (WIN32OLERuntime
Error)
HRESULT error code:0x800706ba
The RPC server is unavailable. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `title'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1302:in `bring_to_front'
from C:/Documents and Settings/Michael Bolton/My Documents/Ruby Scripts/zillion.rb:6:in `startBrowser'
from C:/Documents and Settings/Michael Bolton/My Documents/Ruby Scripts/zillion.rb:12
from C:/Documents and Settings/Michael Bolton/My Documents/Ruby Scripts/zillion.rb:11:in `times'
from C:/Documents and Settings/Michael Bolton/My Documents/Ruby Scripts/zillion.rb:11C:\Documents and Settings\Michael Bolton\My Documents\Ruby Scripts>zillion.rb
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1122:in `method_missing': (WIN32OLERuntimeError)
OLE error code:0 in <Unknown>
<No Description>
HRESULT error code:0x800706be
The remote procedure call failed. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1122:in `set_defaults'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1087:in `initialize'
from C:/Documents and Settings/Michael Bolton/My Documents/Ruby Scripts/zillion.rb:4:in `new'
from C:/Documents and Settings/Michael Bolton/My Documents/Ruby Scripts/zillion.rb:4:in `startBrowser'
from C:/Documents and Settings/Michael Bolton/My Documents/Ruby Scripts/zillion.rb:12
from C:/Documents and Settings/Michael Bolton/My Documents/Ruby Scripts/zillion.rb:11:in `times'
from C:/Documents and Settings/Michael Bolton/My Documents/Ruby Scripts/zillion.rb:11In each case, the program pooped out after opening and closing the browser about 10 times or so. (It would be easy to get a better count.)In Marco's original version, note that he doesn't close the browser explicitly. In those cases, the browser stays open when the function that creates it goes out of scope. I don't know much about this OO stuff, but I would believe that it's the intention for the browser to get garbage collected after it goes out of scope, but that doesn't happen immediately.Also note that, in answer to Jonathan's question, Marco doesn't use winclickers, but he plainly uses AutoIt if you look way down below.---Michael B.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Bret Pettichord
Sent: February 8, 2006 6:42 PM
To: [email protected]
Subject: Re: [Wtr-general] The object invoked has disconnected from itsclients.Marco,
Thank you for the detailed reply.
I think you are running into a problem that i've also seen intermittently. My theory is that there is a resource leak in Watir. After a certain point, you start getting these errors.
What i have found is that you can correct this problem by killing the IEXPLORE.EXE process -- at least for a while. Rebooting has the same effect. But with time, it recurs.
The reason i think this is a resource or memory leak is as follows.
If you start and stop IE manually, you'll see that the IEXPLORE process dies when IE is closed. However, if you start and stop IE from a Watir script, the IEXPLORE process is still running.
This is a problem that very much concerns me. For various reasons, automated tests tend to open and close browsers more frequently than humans, so i need to be able to do this reliably.
I'm planning to look into this further and would appreciate any ideas that anyone has about this.
Bret
On 2/8/06, Neri, Marco < [EMAIL PROTECTED]> wrote:Brett
good point about having to put the call to goto before bring_to_front.
I suspect the problem may be something corrupt within ie or the OS. what
I'd originally set up was a module
module ModuleBrowser
def startBrowser()
ie = IE.new
ie.goto(@test_site)
ie.bring_to_front()
ie.maximize()
return ie
end
end
I'd then do a call @ie = startBrowser() from within my scripts. That was
working reliably. I then started having the errors. So I removed the
module and put that code directly into my script to see if the problem
was perhaps getting the reference to the ie object. That didn't work
Reason I suspect something corrupt is that running only
@ie = IE.new
@ie.goto("http://www.google.com")
is throwing
WIN32OLERuntimeError: Unknown property or method `navigate'
HRESULT error code:0x80010108
The object invoked has disconnected from its clients.
If I run only
@ie = IE.new
is throwing
WIN32OLERuntimeError: document
OLE error code:80004005 in <Unknown>
It's not a consistent 100% failure sometimes the scripts run but more
often than not they don't.
So I'll have to try options
1) re-install ie
2) move all scripts to another box and if it runs reliably there I can
conclude that problem is within the OS and not ruby/watir/my scripts.
Thanks for helping
I'll let you know what I find
Marco
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Bret Pettichord
Sent: Wednesday, 8 February 2006 16:38
To: [email protected]
Subject: Re: [Wtr-general] The object invoked has disconnected from its
clients.
Marco,
I think i may know what the problem is.
Please tell us whether this reliably fixes it:
@ie = IE.new
@ie.goto("http://www.google.com") # any site will do
@ie.bring_to_front()
Bret
On 2/7/06, Neri, Marco < [EMAIL PROTECTED]> wrote:
Has anyone else run into this error? ( whats worse is it's
intermittent
).
I've tried uninstall/reinstall of ruby and watir.
>From within my test script I start an ie browser window as per
normal
@ie = IE.new
@ie.bring_to_front()
A new browser window is popped up. And that's as far as it gets.
And the error is
1) Error:
test001(TC_test001):
WIN32OLERuntimeError: Unknown property or method `document'
HRESULT error code:0x80010108
The object invoked has disconnected from its clients.
C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in
`method_missing'
C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1237:in `title'
C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1302:in
`bring_to_front'
# Make the window come to the front
def bring_to_front
autoit = WIN32OLE.new('AutoItX3.Control')
autoit.WinActivate title, ''
end
# Return the title of the window
def title
@ ie.document.title
end
=======================================================
The information contained in this email and any files attached
may
be confidential information to the intended recipient and may be
the subject of legal professional privilege or public interest
immunity.
If you are not the intended recipient, any use, disclosure or
copying is
unauthorised.
If you have received this document in error please telephone
1300 307 082
*******************************************************************
This footnote also confirms that this email message has been
swept
for the presence of computer viruses.
*******************************************************************
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
=======================================================
The information contained in this email and any files attached may
be confidential information to the intended recipient and may be
the subject of legal professional privilege or public interest immunity.
If you are not the intended recipient, any use, disclosure or copying is
unauthorised.
If you have received this document in error please telephone 1300 307 082
*******************************************************************
This footnote also confirms that this email message has been swept
for the presence of computer viruses.
*******************************************************************
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
