it might be a timing issue? What I might do is consider using the .window method instead of attach. I think that way you might be able to wait until it is present before trying to use it
if I recall correctly we're pretty much deprecating .attach in favor of .window(:how => 'what').use That would also make your code more directly compatible with watir-webdriver should you want to test against something other than just IE. On Tuesday, March 19, 2013 3:44:47 AM UTC-7, alexandre vansteene wrote: > > Hello all, > > I am currently doing my first script using Watir and I am experiencing an > issue. I tried to get an answer by reading many posts but I was not able to > find by myself. > > At some point during the scenario that I am automating, a pop-up appears > and I just want to click on a "OK" button. I am doing it with this piece of > code: > > ie2 = Watir::IE.attach(:title, "Confirm") > print "checkpoint 2\n" > ie2.button(:name => "OK").click_no_wait > > These instructions work fine on 2 computers but it fails for 2 other > computers. I am using same version of ruby, IE, watir libraries and same > OS. I am sure that this is due to this instruction and I don't know why I > get this error: > > irb(main):003:0> ie2=Watir::IE.attach(:title, "Google") > WIN32OLERuntimeError: (in OLE method `Windows': ) > OLE error code:80070002 in <Unknown> > <No Description> > HRESULT error code:0x80020009 > Une exception s?est produite. > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c > lassic/ie-class.rb:116:in `method_missing' > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c > lassic/ie-class.rb:116:in `each' > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c > lassic/ie-class.rb:173:in `_find_all' > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c > lassic/ie-class.rb:166:in `_find' > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c > lassic/ie-class.rb:653:in `block in attach_browser_window' > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c > lassic/wait.rb:24:in `until' > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c > lassic/ie-class.rb:652:in `attach_browser_window' > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c > lassic/ie-class.rb:557:in `_attach_init' > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c > lassic/ie-class.rb:105:in `attach' > from (irb):3 > from C:/Ruby193/bin/irb:12:in `<main>' > irb(main):004:0> ie2=Watir::IE.attach(:title, "Google") > > I have found on the attach function "man" that it could be due to the fact > that Ruby has not to be executed as a service. I didn't find it in the > service list so could you please give me a clue about my problem ? > > Thank you very much in advance. > Kind regards, > > > -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
