Here is my code modified with Thread, I am not getting any error
message when I use click_no_wait. But I did not see the popup message
either to click.
When I use click method I see the popup message but it did not click
on "%Yes" ("Yes" is the text shown on button but when I see HTML for
that I see it as "%Yes") button on the popup.

Any thoughts?


#################################################################################
require "watir"
require 'test/unit'
require "win32ole"
require 'watir/screen_capture'
require 'watir\ie'
require 'watir\contrib\enabled_popup'
require 'watir/winClicker'


#............................"Siva Code" Code START for handling a
popup........................................

def jsClick( ie, button, user_input=nil)
  begin
 waitTime=3
 hwnd = ie.enabled_popup(waitTime)
 puts("wait time = 30")
 puts "hwnd = " + hwnd
 puts "Button value = #{button}"
 puts "User Input = #{user_input}"
  if (hwnd)
  puts("if = hwnd")
    w = WinClicker.new
   if ( user_input )
   puts("if = user input")
     w.setTextValueForFileNameField(hwnd, "#{user_input}")
   end
   sleep 3
   puts ("CLICK THE BUTTON")
    w.clickWindowsButton_hwnd(hwnd, "#{button}")
    w=nil
  end
 rescue Exception
 print "error boss\n"
 end
end
#............................"Shiva Code" Code END for handling a
popup........................................

############################################################################################
ie.image(:id,
'ctl00_contentChildWindow_secFieldMappings_ctl02_menu_secFieldMappings_DXI3_Img').click
sleep 3
puts "done clicking on create default field mappings"

    Thread.new{
      puts "Start clicking on '&Yes' button on popup."
      jsClick(ie, "&Yes")
      puts "End clicking on '&Yes' button on popup."
    }
####################################################

Thank you,
Satish.

On May 17, 2:59 pm, satish <spanchumar...@gmail.com> wrote:
> yup, its not working for me.
> Even Shiva code is not working.
> I got "Error Boss" message. Its directly througing error message.
>
> How to work with treads? I never did this before.
>
> Thanks
> Satish.
>
> On May 17, 2:15 pm, kiran <gki...@gmail.com> wrote:
>
>
>
> > Hi,
> > I think here click_no_wait method doesn't work here.
> > you have to handle this by using threads.
> > thanks,
> > kiran.
>
> > On May 17, 8:05 am, sHiVa <krapa.ph...@gmail.com> wrote:
>
> > > Hi Sathish,
> > > Use this code to click on a popup
>
> > > require 'test/unit'
> > > require 'watir/ie'
> > > require 'win32ole'
> > > require 'watir/screen_capture'
> > > require 'watir\contrib\enabled_popup'
>
> > > #............................Code START for handling a
> > > popup........................................
>
> > > def jsClick( ie, button, user_input=nil)
> > >   begin
> > >  waitTime=3
> > >  hwnd = ie.enabled_popup(waitTime)
> > >  puts("wait time = 30")
> > >   if (hwnd)
> > >   puts("if = hwnd")
> > >     w = WinClicker.new
> > >    if ( user_input )
> > >    puts("if = user input")
> > >      w.setTextValueForFileNameField(hwnd, "#{user_input}")
> > >    end
> > >    sleep 3
> > >    puts ("CLICK THE BUTTON")
> > >     w.clickWindowsButton_hwnd(hwnd, "#{button}")
> > >     w=nil
> > >   end
> > >  rescue Exception
> > >  print "error boss\n"
> > >  end
> > > end
> > > #............................Code END for handling a
> > > popup........................................
>
> > > ie.image(:id,
> > > 'ctl00_contentChildWindow_secUserDetails_ctl02_menu_secUserDetails_DXI0_Img­­­­').click_no_wait
> > > jsClick(ie, "OK")
>
> > > Regards
> > > Siva Phaneendra Krapa
> > > Virtusa- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to