I still don't understand it all exactly. You had a browser object and
ended up on the page where was a button, which created a javascript
dialog upon clicking and then you used #attach for some reason and it
didn't work? #attach should work, i don't see any reasons why it
shouldn't.

But regarding Javascript popups i'd avoid them altogether by
overriding appropriate javascript function at correct place. You can
read more about that from "Simplest way to stop JavaScript Pop Ups
from showing when running your Watir tests" at
http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

Jarmo

On Jun 5, 1:05 pm, Babitha <babitha.augus...@gmail.com> wrote:
> My original code contained an IE.attach to connect to the page where I
> had the button that was pop opening the javascript dialog.
> This is what I modified. Not the internal watir code.
>
> So, in my original code I had to do:
>
> browser.goto(:url) instead of the IE.attach that I was doing.
>
> But, I still have this question..is it a known issue?
>
> On Jun 4, 2:01 pm, Jarmo Pertman <jarm...@gmail.com> wrote:
>
>
>
>
>
>
>
> > How did you manage to exactly fix it with #goto?
>
> > Jarmo
>
> > On Jun 3, 7:32 am, Babitha <babitha.augus...@gmail.com> wrote:
>
> > > Finally, I found what the issue was.
>
> > > It is happening because I am using IE.attach to attach to the page
> > > instead of using browser.Start or browser.goto.
> > > With browser.goto things started working fine.
>
> > > Apparently the error message that was logged by the $DEBUG= true
> > > itself helped me. I saw that internally there is again a call to do an
> > > IE.attach, and I guessed that may be failing. 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....
>
> > > > Can somebody please help me with this?
> > > > Thanks,
> > > > Babitha- Hide quoted text -
>
> > - Show quoted text -

-- 
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

Reply via email to