[Untitled]‎ > ‎

Replace QTP - Part 2 (Windows automation with AutoIt)

In my previous post, I discussed how you're better off using Selenium for browser automation instead of QTP. In this post, I'll discuss how you can do windows application automation using AutoIt or rather more specifically Win32 API. Note: WIn32 API does not mean 32-bit Windows API, but rather it should be read as Windows API. The moniker is just a hangover from older days. AutoIt is actually a rather user friendly (or scripter friendly) wrapper over the Windows API. It has its own script called AutoIt script and it's own interpreter. There are tons of examples & scripts on their site & their help file is really well written with clear examples. OK, it all sounds great, but how does it help us especially with it's own script? How does that help us integrate it in to own programming environment? And more importantly, how can it be a much better alternative to QTP? 

AutoIt COM dll

AFAIK, one of the most useful aspect of AutoIt is that the developers exposed most of it's functionality via a COM dll (32 & 64 bit). Practically every programming language has some means of consuming COM dlls. I'll be discussing examples with Perl, but this discussion should easily port to other languages like Ruby, Python etc. Let us take a look at a simple example: