[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2011-01-27 Thread Kushal
Hi all,

I figured out the issue. The popup which had the button for opening
the modal dialog had a drop down list and the button which opened the
modal dialog. When a value is selected from the drop down list, the
pop up reloads. So, I had to attach the popup again, before I used
click_no_wait and it worked.

Thanks to all for all your replies.

Kushal

On Dec 7 2010, 8:12 pm, dt_nz david.tay...@sungard.com wrote:
 Hi,
 I had a similiar problem that began when I started using IE8.  I found
 (and could be wrong) that WinClicker didn't seem to handle the popup,
 so, I am now using the method clickprompt which I borrowed 
 fromhttp://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

 It works for IE8 and IE7.

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


[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-12-07 Thread Kushal
Hi all,

Thanks for all the posts. I am not really trying to access the button
by using unique_number. The click_no_wait function in element class
passes the command to spawned_click_no_wait_command which refers to
the element using unique_number.

I have seen the example on the page: 
http://wiki.openqa.org/display/WTR/Modal+Dialogs.
And, there is not problem of page hanging up after click_no_wait is
used to click on button for modal dialog. So, in this case, WATIR is
able to access the button using unique_number. However, in my case it
is not.

Also, I verified that click_no_wait is using the correct hwnd.

I have no clue what to do with this.

Kushal


On Dec 3, 7:03 am, Arto Vuori vuo...@iki.fi wrote:
 You're right, I don't really need to do that. Thanks for helping out!

 --A. Vuori

 On 1 joulu, 10:38, Jarmo Pertman jarm...@gmail.com wrote:

  Why are you running your tests in $DEBUG mode anyway? There should be
  a lot of information in your console if $DEBUG is enabled all the
  time. Do you really need it? It seems to me that you're just doing it
  wrong if it's enabled for your whole testsuite...

  You can monkey-patch that if it's really needed:

  module Watir
    class Element
     def spawned_click_no_wait_command(command)
        command = -e #{command.inspect}
        start rubyw #{command}
        end
      end
    end
  end

  Jarmo Pertman
  -
  IT does really matter -http://www.itreallymatters.net

  On Nov 30, 8:36 am, Arto Vuori vuo...@iki.fi wrote:

   Ah, there seems to be a design decision between debugging
  click_no_waitoutput and breaking the method in debug mode. The latter
   was confusing, the former was on the other hand very helpful
   initially. Could there be another way of debugging the output of
  click_no_wait, as now it is not possible to run tests (that are using
  click_no_wait) in debug mode at all? Therefore, I must leave my change
   in place.

   --A. Vuori

   On 30 marras, 02:27, Jarmo Pertman jarm...@gmail.com wrote:

Arto Vuori:
#click_no_waitis only blocking intentionally when $DEBUG is true. As
soon as you use it normally (e.g. $DEBUG being false) then start
rubyw is used to perform the click itself thus the change made by you
should not be needed and it should work without that either. Just make
sure that $DEBUG is not true :)

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


[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-12-07 Thread dt_nz
Hi,
I had a similiar problem that began when I started using IE8.  I found
(and could be wrong) that WinClicker didn't seem to handle the popup,
so, I am now using the method clickprompt which I borrowed from
http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

It works for IE8 and IE7.

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


[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-12-03 Thread Arto Vuori
You're right, I don't really need to do that. Thanks for helping out!

--A. Vuori


On 1 joulu, 10:38, Jarmo Pertman jarm...@gmail.com wrote:
 Why are you running your tests in $DEBUG mode anyway? There should be
 a lot of information in your console if $DEBUG is enabled all the
 time. Do you really need it? It seems to me that you're just doing it
 wrong if it's enabled for your whole testsuite...

 You can monkey-patch that if it's really needed:

 module Watir
   class Element
    def spawned_click_no_wait_command(command)
       command = -e #{command.inspect}
       start rubyw #{command}
       end
     end
   end
 end

 Jarmo Pertman
 -
 IT does really matter -http://www.itreallymatters.net

 On Nov 30, 8:36 am, Arto Vuori vuo...@iki.fi wrote:







  Ah, there seems to be a design decision between debugging
 click_no_waitoutput and breaking the method in debug mode. The latter
  was confusing, the former was on the other hand very helpful
  initially. Could there be another way of debugging the output of
 click_no_wait, as now it is not possible to run tests (that are using
 click_no_wait) in debug mode at all? Therefore, I must leave my change
  in place.

  --A. Vuori

  On 30 marras, 02:27, Jarmo Pertman jarm...@gmail.com wrote:

   Arto Vuori:
   #click_no_waitis only blocking intentionally when $DEBUG is true. As
   soon as you use it normally (e.g. $DEBUG being false) then start
   rubyw is used to perform the click itself thus the change made by you
   should not be needed and it should work without that either. Just make
   sure that $DEBUG is not true :)

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


[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-12-01 Thread Jarmo Pertman
Why are you running your tests in $DEBUG mode anyway? There should be
a lot of information in your console if $DEBUG is enabled all the
time. Do you really need it? It seems to me that you're just doing it
wrong if it's enabled for your whole testsuite...

You can monkey-patch that if it's really needed:

module Watir
  class Element
   def spawned_click_no_wait_command(command)
  command = -e #{command.inspect}
  start rubyw #{command}
  end
end
  end
end

Jarmo Pertman
-
IT does really matter - http://www.itreallymatters.net


On Nov 30, 8:36 am, Arto Vuori vuo...@iki.fi wrote:
 Ah, there seems to be a design decision between debugging
 click_no_wait output and breaking the method in debug mode. The latter
 was confusing, the former was on the other hand very helpful
 initially. Could there be another way of debugging the output of
 click_no_wait, as now it is not possible to run tests (that are using
 click_no_wait) in debug mode at all? Therefore, I must leave my change
 in place.

 --A. Vuori

 On 30 marras, 02:27, Jarmo Pertman jarm...@gmail.com wrote:







  Arto Vuori:
  #click_no_waitis only blocking intentionally when $DEBUG is true. As
  soon as you use it normally (e.g. $DEBUG being false) then start
  rubyw is used to perform the click itself thus the change made by you
  should not be needed and it should work without that either. Just make
  sure that $DEBUG is not true :)

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


[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-11-29 Thread Arto Vuori
Hi,

thanks for helping us out, Jarmo!

I learned that if I attach to an IE process that is not opened by
Watir::Browser.New, watir is able to locate the Window by its hwnd and
attach to it.

After this the problem was that the newly created ruby process itself
blocked blocking the main process well. This problem went away after I
changed element.rb::Element.spawned_click_no_wait_command so that I
prefixed the returned command string with start. Now it is start
ruby #{command}.

Now it works for me on Windows 7.

-- A. Vuori


On 24 marras, 11:50, Arto Vuori vuo...@iki.fi wrote:
 Hi Kushal,

 I'm having exactly the same problem and I have not found a working
 solution.
 I have a need to open and interact with a modal dialog. 
 However,click_no_waitsimply returns nil.

 -- A. Vuori

 On 21 marras, 20:29, Kushal kushal...@gmail.com wrote:







  Hi all,

  I am stuck in this problem for three days now. I need to open a modal
  dialog from a button on a webpage. When I use click or
  fire_event(onclick), execution just hangs. This is understandable as
  it waits for work to be completed on the modal dialog.

  Therefore, I am trying to useclick_no_wait, but it returns nil. I
  made some changes in theclick_no_waitfunction, to display the call
  by adding puts command on line 249 and replaced start rubyw
  #{command} with rubyw #{command}

  I get the following error on the console:

  c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:58:in
  `assert_exists': Unable to locate element, using :unique_number, 1
  (Watir::Exception::UnknownObjectException)
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
  element.rb:263 :in `click!' from -e:1

  The command that is executed in the above call is:

  ruby -e require 'rubygems';require 'c:/ruby/lib/ruby/gems/1.8/gems/
  watir-1.6.7/lib/watir/core';Watir::Button.new(Watir::IE.attach(:hwnd,
  656538), :unique_number, 1).click!

  Also, I read this article (http://jira.openqa.org/browse/WTR-144)
  which describes how fire_event_no_wait could be added to element.rb
  for fire_event(onmousedown) with no wait. However,
  eval_in_spawned_process method is not present in PageContainer module
  in Watir 1.6.7.

  Thanks.

  Kushal

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


[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-11-29 Thread Chuck van der Linden
I'd suggest looking at some of the other solutions listed here:
http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups  perhaps one of
them will work better.

Otherwise specific answers to each step of the IRB process that Jarmo
suggests, (are you getting the right hwnd, etc) might help to figure
out where things are going wrong.  (if you are not attaching to the
right window for example, that would cause this problem)

also be aware that unique_number is not a standard means of
identifying an HTML Element for watir (at least I don't see it listed
anywhere in our docs for the methods supported by various HTML
Elements).  I see it referenced only in places such as in step 6 of
solution #5 on the page referenced above, where the code i creating a
select_no_wait method. I don't think you will be able to use that as a
way to select a button to click on (at least its not listed anywhere
in the docs as a 'how' for identifying a button).   Others more
familiar with the guts of the Watir code might correct me on this, but
I suspect you might need to find another way to identify the button
you are trying to cick

On Nov 28, 12:00 pm, Kushal kushal...@gmail.com wrote:
 Hi Jarmo,

 Thanks for your post.

 But, I still get the same error i.e.
 Watir::Exception::UnknownObjectException: Unable to locate element,
 using :unique_number, 1 when I use:

 require watir
 b = Watir::Browser.attach :title, /title/
 b.button(:unique_number, 1).click

 Thanks.

 Kushal

 On Nov 25, 11:03 am, Jarmo Pertman jarm...@gmail.com wrote:



  #click_no_wait returning nil is a correct behavior. Open up the page
  in your browser where that button is and then open up an irb session
  and try this:
  require watir
  b = Watir::Browser.attach :title, /title/
  b.button(:unique_number, 1).click

  Does that do anything or does it throw the same error message as with
  #click_no_wait?

  If it stays blocking then open up yet another irb session (because the
  previous is unusable due to blocking) and try again to set $DEBUG=true
  and perform #click_no_wait to see the handle to the IE.

  Now attach again to the window and see if that hwnd matches to your
  window's hwnd:
  b = Watir::Browser.attach :title, /title/
  # verify that you have the correct window
  b.title
  b.url

  # now verify that the hwnd matches to the hwnd used by #click_no_wait
  b.hwnd

  # now try the attach command by #click_no_wait
  b = Watir::IE.attach(:hwnd, THE_HWND)
  # try to access the button
  b.button(:unique_number, 1).html

  Jarmo Pertman
  -
  IT does really matter -http://www.itreallymatters.net

  On Nov 24, 11:50 am, Arto Vuori vuo...@iki.fi wrote:

   Hi Kushal,

   I'm having exactly the same problem and I have not found a working
   solution.
   I have a need to open and interact with a modal dialog. However,
   click_no_wait simply returns nil.

   -- A. Vuori

   On 21 marras, 20:29, Kushal kushal...@gmail.com wrote:

Hi all,

I am stuck in this problem for three days now. I need to open a modal
dialog from a button on a webpage. When I use click or
fire_event(onclick), execution just hangs. This is understandable as
it waits for work to be completed on the modal dialog.

Therefore, I am trying to useclick_no_wait, but it returns nil. I
made some changes in theclick_no_waitfunction, to display the call
by adding puts command on line 249 and replaced start rubyw
#{command} with rubyw #{command}

I get the following error on the console:

c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:58:in
`assert_exists': Unable to locate element, using :unique_number, 1
(Watir::Exception::UnknownObjectException)
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
element.rb:263 :in `click!' from -e:1

The command that is executed in the above call is:

ruby -e require 'rubygems';require 'c:/ruby/lib/ruby/gems/1.8/gems/
watir-1.6.7/lib/watir/core';Watir::Button.new(Watir::IE.attach(:hwnd,
656538), :unique_number, 1).click!

Also, I read this article (http://jira.openqa.org/browse/WTR-144)
which describes how fire_event_no_wait could be added to element.rb
for fire_event(onmousedown) with no wait. However,
eval_in_spawned_process method is not present in PageContainer module
in Watir 1.6.7.

Thanks.

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


[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-11-29 Thread Jarmo Pertman
Arto Vuori:
#click_no_wait is only blocking intentionally when $DEBUG is true. As
soon as you use it normally (e.g. $DEBUG being false) then start
rubyw is used to perform the click itself thus the change made by you
should not be needed and it should work without that either. Just make
sure that $DEBUG is not true :)

Chuck van der Linden:
unique_number is indeed not intended way of locating elements
manually, but it is possible to use that in the case above where the
page itself should be exactly the same when trying to find out the
problem.

unique_number is actually a uniqueNumber [1] property's value from the
OLE object directly. That's why you can't see it mentioned anywhere in
Watir's source code.

[1] http://msdn.microsoft.com/en-us/library/ff728873(v=VS.85).aspx

Jarmo Pertman
-
IT does really matter - http://www.itreallymatters.net

On Nov 29, 8:16 pm, Chuck van der Linden sqa...@gmail.com wrote:
 I'd suggest looking at some of the other solutions listed 
 here:http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups perhaps one of
 them will work better.

 Otherwise specific answers to each step of the IRB process that Jarmo
 suggests, (are you getting the right hwnd, etc) might help to figure
 out where things are going wrong.  (if you are not attaching to the
 right window for example, that would cause this problem)

 also be aware that unique_number is not a standard means of
 identifying an HTML Element for watir (at least I don't see it listed
 anywhere in our docs for the methods supported by various HTML
 Elements).  I see it referenced only in places such as in step 6 of
 solution #5 on the page referenced above, where the code i creating a
 select_no_wait method. I don't think you will be able to use that as a
 way to select a button to click on (at least its not listed anywhere
 in the docs as a 'how' for identifying a button).   Others more
 familiar with the guts of the Watir code might correct me on this, but
 I suspect you might need to find another way to identify the button
 you are trying to cick

 On Nov 28, 12:00 pm, Kushal kushal...@gmail.com wrote:







  Hi Jarmo,

  Thanks for your post.

  But, I still get the same error i.e.
  Watir::Exception::UnknownObjectException: Unable to locate element,
  using :unique_number, 1 when I use:

  require watir
  b = Watir::Browser.attach :title, /title/
  b.button(:unique_number, 1).click

  Thanks.

  Kushal

  On Nov 25, 11:03 am, Jarmo Pertman jarm...@gmail.com wrote:

   #click_no_wait returning nil is a correct behavior. Open up the page
   in your browser where that button is and then open up an irb session
   and try this:
   require watir
   b = Watir::Browser.attach :title, /title/
   b.button(:unique_number, 1).click

   Does that do anything or does it throw the same error message as with
   #click_no_wait?

   If it stays blocking then open up yet another irb session (because the
   previous is unusable due to blocking) and try again to set $DEBUG=true
   and perform #click_no_wait to see the handle to the IE.

   Now attach again to the window and see if that hwnd matches to your
   window's hwnd:
   b = Watir::Browser.attach :title, /title/
   # verify that you have the correct window
   b.title
   b.url

   # now verify that the hwnd matches to the hwnd used by #click_no_wait
   b.hwnd

   # now try the attach command by #click_no_wait
   b = Watir::IE.attach(:hwnd, THE_HWND)
   # try to access the button
   b.button(:unique_number, 1).html

   Jarmo Pertman
   -
   IT does really matter -http://www.itreallymatters.net

   On Nov 24, 11:50 am, Arto Vuori vuo...@iki.fi wrote:

Hi Kushal,

I'm having exactly the same problem and I have not found a working
solution.
I have a need to open and interact with a modal dialog. However,
click_no_wait simply returns nil.

-- A. Vuori

On 21 marras, 20:29, Kushal kushal...@gmail.com wrote:

 Hi all,

 I am stuck in this problem for three days now. I need to open a modal
 dialog from a button on a webpage. When I use click or
 fire_event(onclick), execution just hangs. This is understandable as
 it waits for work to be completed on the modal dialog.

 Therefore, I am trying to useclick_no_wait, but it returns nil. I
 made some changes in theclick_no_waitfunction, to display the call
 by adding puts command on line 249 and replaced start rubyw
 #{command} with rubyw #{command}

 I get the following error on the console:

 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:58:in
 `assert_exists': Unable to locate element, using :unique_number, 1
 (Watir::Exception::UnknownObjectException)
         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
 element.rb:263 :in `click!' from -e:1

 The command that is executed in the above call is:

 ruby -e require 'rubygems';require 'c:/ruby/lib/ruby/gems/1.8/gems/
 

[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-11-29 Thread Arto Vuori
Ah, there seems to be a design decision between debugging
click_no_wait output and breaking the method in debug mode. The latter
was confusing, the former was on the other hand very helpful
initially. Could there be another way of debugging the output of
click_no_wait, as now it is not possible to run tests (that are using
click_no_wait) in debug mode at all? Therefore, I must leave my change
in place.

--A. Vuori

On 30 marras, 02:27, Jarmo Pertman jarm...@gmail.com wrote:
 Arto Vuori:
 #click_no_waitis only blocking intentionally when $DEBUG is true. As
 soon as you use it normally (e.g. $DEBUG being false) then start
 rubyw is used to perform the click itself thus the change made by you
 should not be needed and it should work without that either. Just make
 sure that $DEBUG is not true :)

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


[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-11-28 Thread Kushal
Hi Jarmo,

Thanks for your post.

But, I still get the same error i.e.
Watir::Exception::UnknownObjectException: Unable to locate element,
using :unique_number, 1 when I use:

require watir
b = Watir::Browser.attach :title, /title/
b.button(:unique_number, 1).click

Thanks.

Kushal

On Nov 25, 11:03 am, Jarmo Pertman jarm...@gmail.com wrote:
 #click_no_wait returning nil is a correct behavior. Open up the page
 in your browser where that button is and then open up an irb session
 and try this:
 require watir
 b = Watir::Browser.attach :title, /title/
 b.button(:unique_number, 1).click

 Does that do anything or does it throw the same error message as with
 #click_no_wait?

 If it stays blocking then open up yet another irb session (because the
 previous is unusable due to blocking) and try again to set $DEBUG=true
 and perform #click_no_wait to see the handle to the IE.

 Now attach again to the window and see if that hwnd matches to your
 window's hwnd:
 b = Watir::Browser.attach :title, /title/
 # verify that you have the correct window
 b.title
 b.url

 # now verify that the hwnd matches to the hwnd used by #click_no_wait
 b.hwnd

 # now try the attach command by #click_no_wait
 b = Watir::IE.attach(:hwnd, THE_HWND)
 # try to access the button
 b.button(:unique_number, 1).html

 Jarmo Pertman
 -
 IT does really matter -http://www.itreallymatters.net

 On Nov 24, 11:50 am, Arto Vuori vuo...@iki.fi wrote:

  Hi Kushal,

  I'm having exactly the same problem and I have not found a working
  solution.
  I have a need to open and interact with a modal dialog. However,
  click_no_wait simply returns nil.

  -- A. Vuori

  On 21 marras, 20:29, Kushal kushal...@gmail.com wrote:

   Hi all,

   I am stuck in this problem for three days now. I need to open a modal
   dialog from a button on a webpage. When I use click or
   fire_event(onclick), execution just hangs. This is understandable as
   it waits for work to be completed on the modal dialog.

   Therefore, I am trying to useclick_no_wait, but it returns nil. I
   made some changes in theclick_no_waitfunction, to display the call
   by adding puts command on line 249 and replaced start rubyw
   #{command} with rubyw #{command}

   I get the following error on the console:

   c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:58:in
   `assert_exists': Unable to locate element, using :unique_number, 1
   (Watir::Exception::UnknownObjectException)
           from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
   element.rb:263 :in `click!' from -e:1

   The command that is executed in the above call is:

   ruby -e require 'rubygems';require 'c:/ruby/lib/ruby/gems/1.8/gems/
   watir-1.6.7/lib/watir/core';Watir::Button.new(Watir::IE.attach(:hwnd,
   656538), :unique_number, 1).click!

   Also, I read this article (http://jira.openqa.org/browse/WTR-144)
   which describes how fire_event_no_wait could be added to element.rb
   for fire_event(onmousedown) with no wait. However,
   eval_in_spawned_process method is not present in PageContainer module
   in Watir 1.6.7.

   Thanks.

   Kushal

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


[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-11-25 Thread Jarmo Pertman
#click_no_wait returning nil is a correct behavior. Open up the page
in your browser where that button is and then open up an irb session
and try this:
require watir
b = Watir::Browser.attach :title, /title/
b.button(:unique_number, 1).click

Does that do anything or does it throw the same error message as with
#click_no_wait?

If it stays blocking then open up yet another irb session (because the
previous is unusable due to blocking) and try again to set $DEBUG=true
and perform #click_no_wait to see the handle to the IE.

Now attach again to the window and see if that hwnd matches to your
window's hwnd:
b = Watir::Browser.attach :title, /title/
# verify that you have the correct window
b.title
b.url

# now verify that the hwnd matches to the hwnd used by #click_no_wait
b.hwnd

# now try the attach command by #click_no_wait
b = Watir::IE.attach(:hwnd, THE_HWND)
# try to access the button
b.button(:unique_number, 1).html

Jarmo Pertman
-
IT does really matter - http://www.itreallymatters.net


On Nov 24, 11:50 am, Arto Vuori vuo...@iki.fi wrote:
 Hi Kushal,

 I'm having exactly the same problem and I have not found a working
 solution.
 I have a need to open and interact with a modal dialog. However,
 click_no_wait simply returns nil.

 -- A. Vuori

 On 21 marras, 20:29, Kushal kushal...@gmail.com wrote:







  Hi all,

  I am stuck in this problem for three days now. I need to open a modal
  dialog from a button on a webpage. When I use click or
  fire_event(onclick), execution just hangs. This is understandable as
  it waits for work to be completed on the modal dialog.

  Therefore, I am trying to useclick_no_wait, but it returns nil. I
  made some changes in theclick_no_waitfunction, to display the call
  by adding puts command on line 249 and replaced start rubyw
  #{command} with rubyw #{command}

  I get the following error on the console:

  c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:58:in
  `assert_exists': Unable to locate element, using :unique_number, 1
  (Watir::Exception::UnknownObjectException)
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
  element.rb:263 :in `click!' from -e:1

  The command that is executed in the above call is:

  ruby -e require 'rubygems';require 'c:/ruby/lib/ruby/gems/1.8/gems/
  watir-1.6.7/lib/watir/core';Watir::Button.new(Watir::IE.attach(:hwnd,
  656538), :unique_number, 1).click!

  Also, I read this article (http://jira.openqa.org/browse/WTR-144)
  which describes how fire_event_no_wait could be added to element.rb
  for fire_event(onmousedown) with no wait. However,
  eval_in_spawned_process method is not present in PageContainer module
  in Watir 1.6.7.

  Thanks.

  Kushal

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


[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-11-24 Thread Arto Vuori
Hi Kushal,

I'm having exactly the same problem and I have not found a working
solution.
I have a need to open and interact with a modal dialog. However,
click_no_wait simply returns nil.

-- A. Vuori


On 21 marras, 20:29, Kushal kushal...@gmail.com wrote:
 Hi all,

 I am stuck in this problem for three days now. I need to open a modal
 dialog from a button on a webpage. When I use click or
 fire_event(onclick), execution just hangs. This is understandable as
 it waits for work to be completed on the modal dialog.

 Therefore, I am trying to useclick_no_wait, but it returns nil. I
 made some changes in theclick_no_waitfunction, to display the call
 by adding puts command on line 249 and replaced start rubyw
 #{command} with rubyw #{command}

 I get the following error on the console:

 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:58:in
 `assert_exists': Unable to locate element, using :unique_number, 1
 (Watir::Exception::UnknownObjectException)
         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
 element.rb:263 :in `click!' from -e:1

 The command that is executed in the above call is:

 ruby -e require 'rubygems';require 'c:/ruby/lib/ruby/gems/1.8/gems/
 watir-1.6.7/lib/watir/core';Watir::Button.new(Watir::IE.attach(:hwnd,
 656538), :unique_number, 1).click!

 Also, I read this article (http://jira.openqa.org/browse/WTR-144)
 which describes how fire_event_no_wait could be added to element.rb
 for fire_event(onmousedown) with no wait. However,
 eval_in_spawned_process method is not present in PageContainer module
 in Watir 1.6.7.

 Thanks.

 Kushal

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


[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-11-23 Thread Kushal
Anyone? And I forgot to mention that I am using IE7.

Thanks.

Kushal

On Nov 21, 12:29 pm, Kushal kushal...@gmail.com wrote:
 Hi all,

 I am stuck in this problem for three days now. I need to open a modal
 dialog from a button on a webpage. When I use click or
 fire_event(onclick), execution just hangs. This is understandable as
 it waits for work to be completed on the modal dialog.

 Therefore, I am trying to use click_no_wait, but it returns nil. I
 made some changes in the click_no_wait function, to display the call
 by adding puts command on line 249 and replaced start rubyw
 #{command} with rubyw #{command}

 I get the following error on the console:

 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:58:in
 `assert_exists': Unable to locate element, using :unique_number, 1
 (Watir::Exception::UnknownObjectException)
         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
 element.rb:263 :in `click!' from -e:1

 The command that is executed in the above call is:

 ruby -e require 'rubygems';require 'c:/ruby/lib/ruby/gems/1.8/gems/
 watir-1.6.7/lib/watir/core';Watir::Button.new(Watir::IE.attach(:hwnd,
 656538), :unique_number, 1).click!

 Also, I read this article (http://jira.openqa.org/browse/WTR-144)
 which describes how fire_event_no_wait could be added to element.rb
 for fire_event(onmousedown) with no wait. However,
 eval_in_spawned_process method is not present in PageContainer module
 in Watir 1.6.7.

 Thanks.

 Kushal

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