Windows Tasks Automation using Auto It

Windows Tasks Automation using Auto It.

Summary:

This article presents the automation of browsing using Internet Explorer and a commercial email provider: Yahoo.

Auto It was used to:

1. automatically start Internet Explorer,

2. login to Yahoo (if the user was not using the option auto-login) via sending key strokes,

3. and then to open the Inbox using the mouse.

Introduction:

Auto It is a free-ware application: http://www.autoitscript.com/autoit3/downloads.shtml

It has a set of functionality that can be readily deployed, i.e., a utility that provides the windows’ names, mouse coordinates, etc.  The caption is shown below:

Your browser may not support display of this image.

To start a program we issue the command: Run(“C:\Program Files\Internet Explorer\iexplore.exe”)

Since automation is accomplished using the windows’ names, the window name is used:

WinWaitActive(“Google – Windows Internet Explorer”)

In the caption below the script is presented:

Your browser may not support display of this image.

Brief description of the script:

Two functions have been defined: login() and go2inbox().

The login function waits until the Yahoo! Mail window is active and then sends keystrokes (user id, tab, password, tab, enter) in order to access the email provider.

The go2inbox also waits until the Yahoo! Mail window is active and then it controls the mouse and directs it to the coordinates specified with:

MouseClick(“left”,45,505,1)   –Notice that the IExplore window must be maximized.

Notes:

Handling the active windows takes the following into consideration:

1. If some windows have similar title but not exactly the same, and still they need to be considered as the same (Yahoo! Mail is common for login and for inbox.  But the exact names differ.  Auto It provides a way to use a substring of the name)

2. If tabbing doesn’t work in a certain window, mouse click is the alternative.

3. When browsing some window the info doesn’t appear immediately.  It is advisable to use the sleep function with a time of 5 seconds to ensure the needed control is available.

Omar Flores

System Integration Test Engineer

Omar.flores.i.t@gmail.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: