I had been getting this error:

WIN32OLERuntimeError: document
    OLE error code:80004005 in <Unknown>
      <No Description>
    HRESULT error code:0x80020009
      Exception occurred.
    c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1336:in `method_missing'
    c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1336:in `document'
    c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1652:in `focus'

I decided to restart my machine and try again, and now I'm able to run
my script without any errors. However, focus still isn't doing what I
would expect. The focus remains on the command prompt even though it's
called and executed.

I did a little bit more experimenting and have discovered that this is
only problem if I have an existing IE window open. If I close up all of
my IE windows and then run my ruby scripts, everything is perfect. The
focus automatically shifts from my command prompt to IE. If I open up my
browser, head to google, and then run my ruby scripts from the command
prompt... the focus remains on the command prompt.

Anyone else have this issue?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bret Pettichord
Sent: Tuesday, September 20, 2005 11:46 AM
To: [email protected]
Subject: Re: [Wtr-general] Focus Issue

At 11:40 AM 9/20/2005, Keith Kaminski wrote:
>I can't get focus to do anything. In fact, whenever I try to use it I
>get an error.

What error do you get?

>It should be as easy as something like this right?
>
>$ie = IE.new
>$ie.goto("http://www.google.com";)
>$ie.focus()

Yes. This works for me.


_____________________
  Bret Pettichord
  www.pettichord.com

_______________________________________________
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

Reply via email to