Ok I finally found what the issue was. It was due to the IE.attach that I am using in the code to attach to the page. Once I started using browser.goto, things started working fine.
Apparently, the error message logged itself helped me identify the issue. I noticed that internally there is again a call to IE.attach when click_no_wait is called, and I guessed probably that is the issue. Please see the relevant part of the error message below: Watir::Button.new(Watir::IE.attach(:hwnd, 591236), :unique_number, 4).click!();" On Jun 2, 1:50 pm, Babitha <babitha.augus...@gmail.com> wrote: > Trust me. I have done my research. I know there were already many > issues reported with element.click_no_wait and most of them are > supposed to be fixed. But, I still have this problem with the latest > version of watir. > > I am pretty sure with the same version of ruby it worked for me in > another system, but as far as I can remember the watir version was an > earlier one. > > My current ruby version is 1.86-26 p(111), watir -1.8.1 > OS: Windows 7, IE 8. > > Here is the problem. > > I have a button on my page, clicking on which it displays a javascript > confirmation dialog. I tried it with click() function, and it works > fine. But, with click_no_wait() nothing happens, and the control just > passes on to the next statement. > Below is my code: > > $b = Watir::IE.attach(:url, "myurl") > sleep(2) > > btn = $b.button(:id, "btnClear") > $DEBUG = true > btn.click_no_wait() > $DEBUG=false > > My page does not use frames. > > As was suggested in some earlier questions, I put $DEBUG=true and > $DEBUG=false statements around the click_no_wait call and below is > what I got. > > #no_wait command: > Exception `WIN32OLERuntimeError' at c:/ruby/lib/ruby/gems/1.8/gems/ > watir-1.8.1/lib/watir/element.rb:208 - > ruby -e "$:.unshift('c:/ruby/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/ > watir/win32ole').unshift('c:/ruby/lib/ruby/gems/1.8/gems/ > commonwatir-1.8.1/lib').unshift('c:/ruby/lib/ruby/gems/1.8/gems/ > firewatir-1.8.1/lib').unshift('c:/ruby/lib/ruby/gems/1.8/gems/ > watir-1.8.1/lib');require 'c:/ruby/lib/ruby/gems/1.8/gems/watir-1.8.1/ > lib/watir/core';Watir::Button.new(Watir::IE.attach(:hwnd, > 591236), :unique_number, 4).click!();" > OLE error code:0 in <Unknown> > <No Description> > HRESULT error code:0x80070057 > The parameter is incorrect. > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/element.rb:58:in > `assert_exists': Unable to locate element, using :unique_number, 4 > (Watir::Exception::UnknownObjectException) > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/ > element.rb:275:in `click!' > from -e:1 > > I have gone > throughhttp://jira.openqa.org/browse/WTR-320andhttp://jira.openqa.org/browse/WTR-459. > > Can somebody please help me with this? > Thanks, > Babitha -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com