Prashant Shewale > Win32-IEAutomation-0.4 > Win32::IEAutomation

Download:
Win32-IEAutomation-0.4.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  8
Open  2
View Bugs
Report a bug
Module Version: 0.4   Source   Latest Release: Win32-IEAutomation-0.5

NAME ^

Win32::IEAutomation - Web application automation using Internet Explorer

SYNOPSIS ^

        use Win32::IEAutomation;
        
        # Creating new instance of Internet Explorer
        my $ie = Win32::IEAutomation->new( visible => 1, maximize => 1);
        
        # Site navigation
        $ie->gotoURL('http://www.google.com');
        
        # Finding hyperlinks and clicking them
        # Using 'linktext:' option (text of the link shown on web page)
        $ie->getLink('linktext:', "About Google")->Click;       
        # Or using 'linktext:' option with pattern matching
        $ie->getLink('linktext:', qr/About Google/)->Click;
        # Or using 'id:' option ( <a id=1a class=q href=......>)
        $ie->getLink('id:', "1a")->Click;
        
        # Finding checkbox and selecting it
        # Using 'name:' option ( <input type = "checkbox" name = "checkme" value = "1"> )
        $ie->getCheckbox('name:', "checkme")->Select;
        # Or using 'aftertext:' option (for checkbox after some text on the web page) 
        $ie->getCheckbox('aftertext:', "some text here")->Select;
        
        # Finding text field and entering data into it
        # Using 'name:' option ( <input type="text" name="username" .......> )
        $ie->getTextBox('name:', "username")->SetValue($user);
        
        # Finding button and clicking it
        # using 'caption:' option
        $ie->getButton('caption:', "Google Search")->Click;
        
        # Accessing controls under frame
        $ie->getFrame("name:", "content")->getLink("linktext:", "All Documents")->Click;
        
        # Nested frames
        $ie->getFrame("name:", "first_frame")->getFrame("name:", "nested_frame");
        
        # Catching the popup as new window and accessing controls in it
        my $popup = $ie->getPopupWindow("title of popup window");
        $popup->getButton('value:', "button_value")->Click;

Additionally it provides methods to interact with security alert dialog, conformation dialog, logon dialog etc.

        # To navigate to some secure site and pushing 'Yes' button of security alert dialog box
        use Win32::IEAutomation;
        use Win32::IEAutomation::WinClicker; # this will provide methods to interact with dialog box
        
        my $ie = Win32::IEAutomation->new();
        $ie->gotoURL("https://some_secure_site.com", 1); # second argument says that don't wait for complete document loading and allow code to go to next line.
        my $clicker = Win32::IEAutomation::WinClicker->new();
        $clicker->push_security_alert_yes();
        $ie->WaitforDone; # we will wait here for complete loading of navigated site

DESCRIPTION ^

This module tries to give web application automation using internet explorer on windows platform. It internally uses Win32::OLE to create automation object for IE. It drives internet explorer using its DOM properties and methods. The module allows user to interact with web page controls like links, buttons, radios, checkbox, text fields etc. It also supports frames, popup window and interaction with javascript dialogs like security alert, confirmation, warning dialog etc.

METHODS ^

CONSTRUCTION AND GENERIC METHODS

LINK METHODS

IMAGE METHODS

BUTTON METHODS

RADIO and CHECKBOX METHODS

SELECT LIST METHODS

TEXTBOX and TEXTAREA METHODS

TABLE METHOD

FRAME METHOD

POPUP METHOD

DIALOG HANDLING METHODS

Win32::IEAutomation::WinClicker class provides some methods to ineract with dialogs like security alert, confirmation dialog, logon dialog etc. COM interface to AutoIt (http://www.autoitscript.com/autoit3/) is used to implement these.

You need to create a new instance of Win32::IEAutomation::WinClicker and then use these methods.

AUTHOR ^

Prashant Shewale <pvshewale@gmail.com>

COPYRIGHT AND LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.