Hi sir,

thanks a lot for the solution it worked for me, since a week i had
problem with handling popup. thankyou very much.

On Mar 3, 8:52 pm, Jim Matthews <jim_m...@swbell.net> wrote:
> Here are the steps to reproduct the problem.  First bring up unittests
> \html\popups1.html in IE.
>
> \Ruby\lib\ruby\gems\1.8\gems\watir-1.6.2\unittests\html\popups1.html
>
> Next run this script.  I have extra "puts" in it to try to figure out
> what is going on. They can be remvoed or commented out.
>
> Jim
>
> require 'watir'
> require 'watir/ie'
> require 'watir/testcase'
> require 'watir/contrib/enabled_popup'
>
> class StepTests < Watir::TestCase
>   def test_01_step_test
>     browser = Watir::IE.attach(:title, /Test page for/)
>     browser.row(:index, 3).button(:type, 'button').click!
>     popupchecker(browser, 'OK')
>   end
>   def popupchecker(browser, text)
>     Timeout::timeout(2) do
>       begin
>         puts "Inside begin of popupcuecker."
>         puts "browser.enabled_popup == #{browser.enabled_popup}"
>         if browser.enabled_popup
>           puts "In if in popupchecker."
>           hwnd = browser.enabled_popup(5)
>           puts hwnd.to_s
>           w = WinClicker.new
>           w.makeWindowActive(hwnd)
>           w.clickWindowsButton_hwnd(hwnd, text)
>         end
>         rescue Timeout::Error
>           puts 'No popup existed.'
>       end
>     end
>   end
> end
>
> On Mar 2, 10:12 am, Jim Matthews <jim_m...@swbell.net> wrote:
>
> > I am trying to deal with javascript popups.  I have created the
> > popupchecker method described on the wiki.
>
> > When I used click_no_wait,  the popup came up but was not dismissed.
> > Someone suggested that I try click! instead of click_no_wait because
> > of some problems mentioned in recent posts.  I did that and click!
> > worked for the first popup.  It dismissed it and the script continued.
>
> > When the script got to the second popup, neither click_no_wait nor
> > click! worked to dismiss the popup.  I put some "puts" statements is
> > the popupchecker method and it appears from that, that popupchecker is
> > not getting called the second time until after I manually dismiss the
> > second popup.
>
> > I know the popupchecker code works because it successfully dismisses
> > the first popup and because I have used fxri with popupchecker to
> > dismiss both the popups.
>
> > Does anyone have an idea what is going on or something different to
> > try?
>
> > Jim
--~--~---------~--~----~------------~-------~--~----~
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