Thursday, April 16, 2015

Autoit Setup for Selenium Webdriver




What is AutoIt

AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokesmouse movement andwindow/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying “runtimes” required!
In layman’s term AutoIt is just another automation tool like Selenium but unlike Selenium it is used for Desktop Automation rather Web Automation.  It is a powerful tool and it just not automate desktop windows, button & form, it automates mouse movements & keystrokes too. Just like Selenium IDE, it also gives you the recording capability which generates the scripts for you to use the same script in you test.

AutoIt Features

1) Easy to learn: It is just another scripting language and very easy to use. Under help menu of AutoIt it gives you all the functions and methods you can use with detailed explanation and examples.
2) Simulates keystrokes: Where ever it is required to use keystrokes in your test, you can use this for example pressing enter on any dialog box and typing username and password on the popup which you cannot simulate with Selenium.
3) Simulate mouse movements: Like keystrokes there can be situations when you are required to simulate the mouse movements and it is the easiest way out for those situations.
4) Scripts can be compiled into standalone executable: It means that you do not require any IDE to run your scripts, you can easily convert your automation scripts into .exe files which can be run on their own.
5) Windows Management: You can expect to move, hide, show, resize, activate, close and pretty much do what you want with windows. Windows can be referenced by title, text on the window, size, position, class and even internal Win32 API handles.
6) Windows Controls: Directly get information on and interact with edit boxes, check boxes, list boxes, combos, buttons, status bars without the risk of keystrokes getting lost.  Even work with controls in windows that aren’t active!
7) Detailed help file and large community-based support forums: You think of any action on windows, you will get it on help file. You face any issue or get stuck anywhere, the large group of users are there to help you.
In short, any windows,  mouse & keystrokes simulation which we cannot handle with Selenium that can be handled with AutoIt. All we need to do is to use the script in Selenium which is generated with the help of AutoIt tool.

Steps to Download AutoIt v3

1) Go to AutoIt website and navigate to download page. It will display the latest version. The top most download is for AutoIt, click on it.
Auto
2) It will open up a pop up box, click on ‘Save File‘ button.
Auto-1
3) Once the download is complete, double click on the .exe file and it will ask for your agreement on their terms and condition. Click on ‘I Agree‘ button.
Auto-2
4) Complete the process and click on the ‘Finish‘ button at the end of the installation.
Auto-4
5) Go to your program menu and look at the AutoIt folder. If you have 32 bit system, then your folder will look like the image below.
Auto-5
If you have 64 bit system and during installation you have choose default x86 configuration, then your folder will  look like the image below.
Auto-5.1

Recording of AutoIt script

Yes I know that you are surprised to see that AutoIt also have recording feature which helps in generating scripts automatically. But for that we need to use its extension called AutoIt Script Editor. Although script editor is also get installed with AutoIt but it comes with very limited feature.

Steps to Download AutoIt Script Editor

1) Go to AutoIt website and navigate to download page. It will display the latest version. The second download is for AutoIt Script Editor, click on it.
AutoS
2) A new page will open, click on the top most link of ‘SciTE4AutoIt3.exe‘ and follow the process until the installation is finished.
AutoS-1

Next post we will see how to handle autoit using selenium.. 

Thanks!!!!

No comments:

Post a Comment