Recipe 26Test Windows GUIs with AutoIt

Problem

You want to test a Windows user interface from pure Ruby, rather than using a compiled .NET language.

Ingredients

  • AutoIt,[165] a freeware Windows automation suite

  • Ruby’s built-in Win32OLE libary[166] to control AutoIt

  • Unit Converter,[167] an example app to test

Solution

Windows power users have used AutoIt for years to perform little daily tasks around their systems. Among other things, AutoIt can launch programs, find windows, and click controls. In this recipe, we’ll write one test case for a simple Windows unit conversion program.

Setup

First, you’ll need to install AutoIt. Download and run the latest AutoIt Full Installation package from the official site.[168] This will register AutoIt’s ActiveX ...

Get Cucumber Recipes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.