Web application automation with AutoIT

Web application automation with AutoIT

Recently I came across a situation during automation where I have to handle a windows security alert pop up for VPN connection. And I begin to explore a tool called AutoIT. This article is an introduction about AutoIT and its features. In one word, AutoIT is a freeware BASIC- like scripting language designed for automating the windows GUI. Now when we talk about any new programming language we always have three questions.

1. What is the language? 

Auto IT is a freeware, it has no cost attached to it and it's a programming language which is designed to automate windows-based application.

2. How AutoIt will help you?

In today's world automation is taking over every field and many IT companies are trying to automate all the possible products they have to reduce cost and man power. Many are running windows based application products but some of these applications are legacy based applications. So there is a demand for talents who are able to automate windows and legacy based applications and this is the right time to learn it. Apart from that,this is skill you can put in on your resume and to say hey I know automation specifically Windows based or legacy based applications and it will boost your chances for an automation test engineer role.

No alt text provided for this image

Third, it can recognize Windows controls. That means the controls which are running on Windows OS, like a calculator or a notepad and it can automatically interact with them. Now let me give you a bit of an idea what I mean by that, so this is something which recognizes the windows control. That means it can automatically identify a windows based control or application and communicate with it in the same way we use a control. AutoIT has a custom made tool for it called AutoIT Window info tool. So, if I hover over the notepad using a after clicking the finder button of the info tool there's a black highlighter which is saying "okay, I'm able to recognize this control". Also, you will get details of the control under usage on the info tool window. Hence, you can pull out a calculator or a different windows control or one, maybe made by you or someone else and you can recognize those controls and then take necessary action without manual interference. That's one of the biggest benefit of AutoIT.

Third, it can recognize Windows controls. That means the controls which are running on Windows OS, like a calculator or a notepad and it can automatically interact with them. Now let me give you a bit of an idea what I mean by that, so this is something which recognizes the windows control. That means it can automatically identify a windows based control or application and communicate with it in the same way we communicate. AutoIT has a custom made tool for it called Finder. So if I hover over the notepad using a finder tool there's a black highlighter which is saying: "okay, I'm able to recognize this control", also you will get details of the control on the AutoIT tool window. In the same way you can pull out a calculator or a different windows control maybe made by you or someone else but you can recognize those controls and then take necessary action without manual interference. That's one of the biggest benefit of AutoIT. In addition, AutoIT has a wonderful control over the keyboard or mouse so you can push any Keys to the application, you can make a left click or right click.

Fourth, is one of the powerful features as it can call any EXE from within your program or it can call any DLL from your application. Imagine you have written some application which goes and fetches some images from the server and puts them into the directory so you can call that exe within your application. You can also call in built windows api function, like get the windows height, width, open up a window, close a window, get the windows property. In short, in built features can be accessed using AutoIT.

Next, one of the biggest feature is that when you write a program and compile it, the exe generated is digitally signed, so AutoIT safe to use. AutoIT supports 64-bit components so that is also good in case of documentation and it has a wonderful site where you can see the list of all the controls it supports, all the possible events which you can call up or you can do things about it. AutoIT has also an excellent active forum where people talk about their problems or the new ideas if you like to implement them.

One last the question is that how easy is it to learn AutoIT? I would say if you try to spend a little bit of time, I would say a week or two constantly on AutoIT and trying to do programming on simple applications you will find it very easy. Now, if you don't spend time on a regular basis with coding, while troubleshooting certain situations things may get a bit tricky and you might see some frustration so I would recommend to go with the coding part more often and once you get the hand of it things become very easy. And one final part is exception handling which is not quite easy so that is something you have to manage by yourself by writing some smarter code.

As an icing on the top of cake AutoIT is supported by Selenium framework and you can use AutoIT to automate non browser related functionalities needed to support or complete a browser automation. As you know, Selenium is an open source tool that is designed to automate web-based applications on different browsers but to handle window GUI and non HTML popups in application AutoIT is required as these window based activity are not handled by Selenium. You can create a script on AutoIT and compile it to create an exe which can be directly called from your Selenium code. This integration is very handy when you have to navigate through windows based controls in order to complete web automation.

In conclusion, AutoIt is a freeware scripting language designed for automating windows GUI and general scripting. It has many good features and uses a combination of mouse movement, keystrokes and window control manipulation to automate a task which is not possible by Selenium Webdriver. It is a great skill addition to Automation testers and anyone who is interested in learning a new language and likes to automate their boring windows based tasks.


Satyam Patil

Lead SDET at TD

4 年

Yeah I have personally used the tool. Its one of the best tool when you have to deal with windows.

要查看或添加评论,请登录

Jobin P.Sunny的更多文章

社区洞察

其他会员也浏览了