Top Tools for Automating UI Testing of Windows GUI

Top Tools for Automating UI Testing of Windows GUI

16 July 2024 Stephan Petzl Leave a comment QA

Automating the UI testing of Windows GUI applications can significantly enhance the efficiency and accuracy of your testing process. This article provides an overview of some of the best tools available for this purpose, helping you choose the right one for your needs.

Sikuli

Sikuli automates anything you see on the screen using image recognition to identify and control GUI components. It is particularly useful when there is no easy access to a GUI’s internal or source code. Sikuli is a versatile tool that can be used across different platforms and applications, making it a valuable addition to any tester’s toolkit.

TestStack White

TestStack White is an open-source framework for automating rich client applications based on Win32, WinForms, WPF, Silverlight, and SWT (Java) platforms. It is .NET based and does not require the use of any proprietary scripting languages. White provides a consistent object-oriented API, hiding the complexity of Microsoft’s UIAutomation library. Below is an example of how you can automate Notepad using White:

using System;
using TestStack.White;
using TestStack.White.InputDevices;
using TestStack.White.UIItems.Finders;
using TestStack.White.UIItems.WindowItems;

namespace WhiteTest
{
    class Program {
        static void Main(string[] args) {
            Tests tests = new Tests();
            tests.Notepad();
        }
    }

    class Tests {
        public void Notepad() {
            // Arrange
            Application app = Application.Launch("notepad.exe");
            Window window = app.GetWindow("Untitled - Notepad");

            // Act
            var box = window.Get(SearchCriteria.ByClassName("Edit"));
            Keyboard.Instance.Send("test", box);

            window.MenuBar.MenuItem("File", "Save As...").Click();
            var filename = window.Get(SearchCriteria.ByClassName("Edit"));
            Keyboard.Instance.Send(DateTime.Now.ToString("yyyyMMddHHmmssffff") + "test.txt", filename);
            window.Get(SearchCriteria.ByText("Save")).Click();

            app.Kill();

            // Assert 
            //  file is created in Documents folder
        }
    }
}

Appium with WinAppDriver

Given the deprecation of Microsoft’s Coded UI Testing tools, Appium combined with WinAppDriver is now recommended for testing desktop and UWP apps. Appium is a popular open-source tool for automating mobile and desktop applications, and WinAppDriver extends its capabilities to Windows applications. This combination provides a robust solution for automated UI testing.

Robot Framework with AutoIt Library

Robot Framework, paired with the AutoIt library, is another excellent choice for automating Windows GUI applications. Robot Framework is a keyword-driven acceptance testing framework that allows you to write tests in a readable, English-like format. It integrates well with version control systems and supports continuous integration through plugins like Jenkins.

FlaUI

FlaUI is a complete rewrite of TestStack White, offering more flexibility and features, including built-in caching. It provides a more modern approach to automating Windows GUI applications and is worth considering if you are looking for an alternative to White.

Katalon Studio

Katalon Studio supports Windows 10 application testing and is based on Winium. It offers a comprehensive solution for automating the testing of desktop applications, starting from version 7.0. More information can be found on their official documentation page.

Conclusion

Choosing the right tool for automating UI testing of Windows GUI applications depends on your specific requirements and existing technology stack. Tools like Sikuli, TestStack White, Appium with WinAppDriver, Robot Framework with AutoIt, FlaUI, and Katalon Studio each offer unique features and advantages.

For those looking to automate testing with minimal coding, Repeato offers a no-code solution for iOS and Android apps. Repeato leverages computer vision and AI to create, run, and maintain automated tests efficiently. It’s particularly fast to edit and run tests, making it a great choice for quality assurance professionals seeking to streamline their testing processes.

Like this article? there’s more where that came from!