Automate Windows Native Apps with RFormSpec/AutoIT3

By mark

"Can TestWise test Windows native apps?" I received this question now and then even the person asked knew TestWise is for testing web applications.

My answer is: YES or NO. (I know it is sounding like a politician). First of all, testing Windows native apps is a lot harder, as there were no standard controls. Identifying some controls are particularly challenging or sometimes impossible. Using screen coords is not a good idea, as the test scripts are too delicate. To make it matter worse, assertion is very limited. For that reason, I prefer the term "automation" rather than "test automation" for native apps.

But there is still value doing automation for native apps. The technology I use is AutoIT3, a free and quite widely used windows scripting engine. AutoIT3 comes with Window Info tool, which can be used to identify control IDs or Control Coords

It is important to note that better using Window based Coord Mode, so that if have to control mouse in your test script, the test script still work when window moved.

I like Ruby, so I created a wrapper for AutoIT3. It is called RFormSpec, free and open-source. TestWise comes with RFormSpec, in many ways it works the same way: Page Object, Auto Complete and Refactoring. By using page objects, the automation script is quite maintainable.

For people know me well, I wouldn't talk something without real demo. Here is a Screencast: Automating Native App: HeidiSQL, and you can find a sample test project form_hedisql_ui_tests under samples (from v3.0.5).