[Wtr-general] Handling Popup

TT Blue jazzeattle at gmail.com
Tue Jun 12 01:59:36 EDT 2007


Tried that too, didn't work.

It's somewhat interesting because with QuickTest Pro, it identified that
dialog as winDialog and I'd thought the winClicker solution would work...
but it didn't.

On 6/11/07, Hayato Iriumi <hiriumi at gmail.com> wrote:
>
> I just went through exactly the same issue.
> Try to use click_no_wait and see what happens.
>
> On 6/11/07, TT Blue <jazzeattle at gmail.com> wrote:
> > I'm new to Watir as well as Ruby, and I need help handling a pop-up
> dialog.
> >
> > I've searched both the mailing list as well as the trying all that I've
> > found, but I couldn't get it to click on the "OK" pop-up button.
> > ==============================================================
> > require 'watir'
> > require 'watir\enabled_popup'
> >  #require 'watir/WinClicker'
> >    def startClicker( button , waitTime= 9, user_input=nil )
> >       # get a handle if one exists
> >       hwnd = $ie.enabled_popup(waitTime)
> >       if (hwnd)  # yes there is a popup
> >         w = WinClicker.new
> >         if ( user_input )
> >           w.setTextValueForFileNameField ( hwnd, "#{user_input}" )
> >         end
> >         # I put this in to see the text being input it is not necessary
> to
> > work
> >         sleep 3
> >         # "OK" or whatever the name on the button is
> >         w.clickWindowsButton_hwnd( hwnd, "#{button}" )
> >         #
> >         # this is just cleanup
> >         w=nil
> >       end
> >     end
> >
> >   switch_role.role.select("my role")
> >   startClicker( "OK", 3, "")
> > ==============================================================
> > when I tried code block above, I get this error message:
> > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `gem_original_require': no such file to load --
> watir\contrib\enabled_popup
> > (LoadError)
> >     from
> > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > `require'
> >     from CMSlogin.rb:2
> >
> > when I try this code block:
> >
> > require 'watir/WinClicker'
> > def sstartClicker( button , waitTime = 3)
> >   w = WinClicker.new
> >   longName = $ie.dir.gsub("/" , "\\" )
> >   shortName = w.getShortFileName(longName)
> >   c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } #{
> > waitTime} "
> >   puts "Starting #{c}"
> >   w.winsystem(c)
> >   w=nil
> > end
> >
> > switch_role.role.select("my role")
> >   startClicker( "OK", 3)
> >
> > This just waits forever and does not click on the OK button.
> >
> > ==============================================================
> >
> > Can someone please help?
> >
> >
> >
> >
> > _______________________________________________
> > Wtr-general mailing list
> > Wtr-general at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/wtr-general
> >
> _______________________________________________
> Wtr-general mailing list
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070611/68828741/attachment.html 


More information about the Wtr-general mailing list