Re: [Wtr-general] Handling Popup

2007-06-11 Thread Hayato Iriumi
I just went through exactly the same issue.
Try to use click_no_wait and see what happens.

On 6/11/07, TT Blue [EMAIL PROTECTED] 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@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Modal dialog

2007-06-07 Thread Hayato Iriumi
Yeah, that's what I was thinking of in my dream. LOL
Thanks for your advice, Bret. :-)

On 6/7/07, Bret Pettichord [EMAIL PROTECTED] wrote:
 Hayato wrote:
  Does anyone know how to resolve this issue? Please let me know.
 
 Don't use threads. Blocking COM calls will block ALL ruby threads.
 You'll have to spawn code to run in a separate process instead.

 Bret



 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general