You could do something like this (in pseudocode):

text_field.set_no_wait(i.to_s)
begin
  original_timeout = RAutomation::Window.wait_timeout
  RAutomation::Window.wait_timeout = 3
  ie.rautomation.child(:title => /part of the
popuptitle/).button(:value => "OK").click
  puts "dialog appeared with number #{i}"
rescue
  # button click failed, e.g. dialog didn't appear
ensure
  RAutomation::Window.wait_timeout = original_timeout
end

Are you bruteforcing something? :)

Jarmo

On Jul 29, 3:53 pm, Asif Iquebal Sarkar <[email protected]> wrote:
> No, that couldn't help.
> I just need to script it down to know whether it's been fired ot not. If
> fired then click on OK button, print the number used and try with a new
> number.
> pseudo code like this....
> for i in(0..100)
>      $ie.text_field(:id,"number_sos").set(i.to_s)
>      if($ie.javascript_dialog.exists?)   ## need something like this
>          $ie.javascript_dialog.button('OK').click
>          puts "Number failed to enter: #{i}"
>      end
> end
> On Fri, Jul 29, 2011 at 5:27 PM, Željko Filipin <
>
>
>
>
>
>
>
>
>
> [email protected]> wrote:
> > On Fri, Jul 29, 2011 at 1:55 PM, Asif Iquebal Sarkar <[email protected]>
> > wrote:
> > > I need to know when the
> > > pop up fired and against which number?
>
> > Maybe this could help:
>
> >http://stackoverflow.com/questions/3787555/how-to-find-out-which-java...
>
> > Željko
> > --
> > watir.com - community manager
> > watir.com/book - author
> > watirpodcast.com - host
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > [email protected]
> >http://groups.google.com/group/watir-general
> > [email protected]
>
> --
> --------------------------------
> Thanks & Regards
> Asif Iquebal Sarkar
> Bhubaneswar, Orissa

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

Reply via email to