Watir has a page checker that allows you to run specific methods on page
load. Something along the lines of this:
module PageCheckers
HANDLE_MODAL = lambda {|ie| ie.modal_dialog.button(:id, 'ok').click} # or
whatever, do something with your modal dialog
end
register the method
ie.add_checker PageCheckers ::HANDLE_MODAL
Now when you go to a page
ie.goto "http://www.google.com <http://microsoft.com/>"
This method is called on page load.
Charley Baker
Lead Developer, Watir, http://wtr.rubyforge.org
On Tue, Aug 18, 2009 at 4:36 AM, Pallavi Sharma <[email protected]>wrote:
> Hi
>
> I have also encountered a similar problem, of handling popup during page
> load and page close events.
>
> Is there any solution for the same in watir??
>
>
> On Tue, Aug 18, 2009 at 2:44 PM, Ste <[email protected]> wrote:
>
>>
>> Hi,
>> I am not able to handle modal dialog window controls when such a
>> window is opened from the page_load event on the server side code
>> (which launches a script included in the .aspx page). In more detail
>> (I have inspected the code) within the function page_load on the
>> server page (.cs) there is a line of code like this
>>
>> ClientScript.RegisterStartupScript( GetType(), "MessaggeRule",
>> "OpenPopUpRule('"+ mode + "','" + idGrid"');", true);
>>
>> then, the javascript function included in the .aspx page OpenPopUpRule
>> () call the method window.showModalDialog().
>>
>> I think this scenario is not included in the page
>> http://wiki.openqa.org/display/WTR/Pop+Ups.
>>
>> In any case I have tried with send_keys() and Watir.autoit.Send() but
>> I am not still able to access these modal dialog window controls.
>>
>> Thanks in advance for your help
>>
>> Ste
>>
>>
>>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---