Select Page

Category Selected: Desktop App Automation Testing

5 results Found


People also read

Artificial Intelligence

What is Artificial Empathy? How Will it Impact AI?

Game Testing

Exploring the Different Stages of Game Testing

API Testing

Comprehensive Bruno Tutorial for API Testing

Talk to our Experts

Amazing clients who
trust us


poloatto
ABB
polaris
ooredo
stryker
mobility
Best Desktop Application Automation Testing Tools in 2024

Best Desktop Application Automation Testing Tools in 2024

Although web and mobile applications are more widely used now, desktop applications still play an integral role for many organizations. So the need to automate desktop applications for testing purposes is still prevalent and we have many test automation tools in the market as well. Being an expert desktop application automation testing company, we have even developed our very own tool for Desktop App Automation called Gyra. Additionally, we also have strong expertise in the other tools from the market. So we wanted to list the best desktop application automation testing tools available as of 2024 and highlight their features so that you can choose the best tool suitable for your needs.

Types of Desktop Applications & Frameworks

But before heading straight to that, we must understand the different types of Desktop Applications and frameworks. So kindly find the list below

  • Win32 Apps – Applications that are created using WinAPI. These applications are typically native Windows GUI apps.
  • Windows Forms (WinForms) Apps – Applications that are created using frameworks like .NET, Delphi, or MFC instead of calling the Win32 API. WinForms was introduced more than 2 decades ago in the year 2001 with .NET 1.0 framework. As WinForms apps perform well in low-configured machines, it is still being used for its performance and lightweight UI.
  • WPF (Windows Presentation Foundation) Apps – It was released in the year 2006 to modernize Desktop App development as it enables you to create visually rich UI applications. WPF supports cross-platform application development using Avalonia UI. However, WinForms and WPF are still Windows-centric and there is no official statement from Microsoft yet.
  • Universal Windows Platform (UWP) Apps – UWP was introduced with Windows 10. You can run the Desktop apps developed using UWP on Windows Desktop PCs, Windows Mobile, Xbox, and mixed reality headsets.
  • Java AWT (Abstract Window Toolkit) – It is a heavy-weight platform-dependent API used to create Desktop Applications.
  • Java Swing – Swing is a legacy toolkit used to create Desktop Applications using Java.
  • JFX – JFX was introduced along with Java 8 and it can be used to create rich Java-based client applications. JFX supports FXML & CSS.
  • macOS Apps – Used to create Desktop Applications for macOS using Xcode & Swift programming
  • Electron – Electron is a framework that can be used to develop desktop applications using JavaScript, HTML, & CSS.
  • QT – QT is a C++ framework. You can build cross-platform desktop applications with native user interfaces.
  • Best Desktop Application Automation Testing Tools

    Now that we have seen what types of desktop applications and frameworks are out there, let’s take a look at the highlights of all the tools one after another to help you choose the best desktop application automation testing tool in 2024. We’re starting the list with FlaUI.

    FLAUI
    • FlaUI is a .NET library.
    • Supported Apps: You can automate Win32, WinForms, WPF, & UWP applications.
    • Programming Language: C#
    • It uses Microsoft’s UI Automation framework to access the UI elements programmatically.
    • It supports XPath locators for some properties.
    • It has automation support for the QT framework type.
    • It requires a steep learning curve.
    • It does not support Swing & JFX applications.
    • You can’t perform remote execution like how you do it using Selenium RemoteWebDriver
    • Latest version: v4.0.0
    WinAppDriver (Windows Application Driver)
    • It is a popular freeware library used for Desktop Application Automation Testing.
    • Supported Platforms – Windows 10 and Windows Server 2016.
    • Supported Application Types – UWP, WPF, WinForms, and legacy Win32.
    • Prerequisite – You need to enable Developer Mode in Windows Settings before performing execution.
    • You can run scripts on a remote machine.
    • It has its own UI recorder which can generate scripts in C#.
    • You can also attach the already launched application and perform action on it.
    • WinAppDriver Locators – AccessibilityId, ClassName, Id, Name, TagName, & XPath.
    • You can also use Appium’s Windows Driver to send WinAppDriver’s APIs.
    Test Complete
    • It is a well-known commercial tool in the market and it offers two license types (Fixed & Floating).
    • You can automate Win32, WinForms, WPF, Telerik, Electron, Delphi, Qt, Syncfusion apps, etc.
    • Supported Programming Languages – JavaScript, Python, VBScript, JScript, DelphiScript, C#, C++.
    • You can create test scripts in two ways – Keyword Tests and Script Tests.
    • Keyword Tests helps you to create Test Scripts in Table format instead of writing coding. When you record the user actions, Test Complete populates Test Scripts in the Keyword Tests table.
    • Keyword Test is helpful if you are doing POC. But if you are looking to create a robust test suite, go for Script Tests.
    • Another notable feature of Test Complete is you can create BDD tests. If you have your Gherkin feature files in Cucumber Studio, you can easily import them into Test Complete.
    • Latest version 15.65
    Gyra
    • Gyra is Codoid’s Home-grown Desktop Application Automation Testing Tool that is available as a freeware.
    • Supported Programming Language – Java.
    • It is easy to set up as it requires no additional configurations.
    • Execution is fast compared with other tools.
    Ranorex
    • Supported Apps – WinForms, WPF, Qt, Java, Delphi, SAP, UWP, MSAA/UIA, CEF, .NET Core, Office and many more.
    • Supported Programming Languages: C# & VB.NET.
    • Reporting – HTML, PDF, JUnit-compatible reports, & Email.
    • You can analyze GUI objects using the Ranorex spy tool.
    • Latest Version: 11.3.2.
    Squish
    • Supported Programming Languages – Python, Perl, JavaScript, Ruby.
    • Supported Apps – Qt, Swing, AWT, SWT, JFX, macOS, Win32, Winforms, WPF, UWP.
    • Go-to tool to automate QT applications.
    • Latest Release – 7.2.

    Conclusion

    As an automation testing service provider, we understand that desktop app automation is more challenging when compared to web and mobile app automation. Given the additional complexity, choosing the right tool for your automation needs is very important. If you choose the right tool and are able to see success in a Proof of Concept, then you are halfway through. We hope the overview we provided for each desktop application automation testing tool will help you in your decision-making process.

How to Automate a Desktop Application using C#?

How to Automate a Desktop Application using C#?

Despite the rise of people using mobile applications, desktop applications are still being used on a daily basis by many. Though you can test a desktop application manually, it is still important for a tester to know how to automate desktop applications in Windows. There are a few ways to go about it, and in this blog, we will be focusing on how to automate a desktop application using C#. In order to achieve that, we’ll be sharing the tried and tested frameworks, tools, strategies, and approaches we have been using over the years to deliver exceptional automated desktop application testing services to our clients. We’ve also provided an example to help you understand everything clearly. So let’s get started.

.NET Framework

.NET Framework is a software development platform developed by Microsoft to build and run windows applications. .NET is used to automate applications in different operating systems such as Linux, macOS, and Windows. Whereas, .NET framework was developed specifically for Windows. So it can be used to run applications in windows environments that were created using the .NET framework.

WinAppDriver (Windows Application Driver)

WinAppDriver is also a test automation framework developed by Microsoft. It is an open-source option that feels like a combination of a WebDriver and Appium. We say this as WinAppDriver is a set of libraries that can be integrated into a test runner that supports Appium. For those who don’t know, Web drivers are used for desktop application automation and Appium is used for mobile app automation. Before we proceed to see how to automate a Desktop application using C#, let’s take a look at the prerequisites for WinAppDriver

  • Windows 10 OS
  • Visual Studio 2013+
  • WinAppDriver.exe
  • Turn ON Developer mode on the PC

BDD Approach

We have used the BDD approach in numerous automation testing projects and have always been satisfied with the results. That is why we have decided to focus on it while explaining how to automate a desktop application using C#. BDD is expanded as Behavior Driven Development, it is an Agile software development process that allows the design, creation, and product testing, using the product’s behavior.

But the major advantage is that it makes it very easy for even non-technical users to understand the purpose of every test without having to know technical terms like classes, methods, and variables. All the important aspects will be explained using Gherkin language that is in the Given, When, and Then format.

Since we will be automating Notepad in our example, we’ve created a feature file in the Gherkin language for easier understanding.

@Demo 
Scenario: Notepad Demo
 Given Launch Notepad 
 When Enter Specified Text
 Then Verify the Entered Text

Specflow

Now that we have discussed the approach we’ll be using, let’s focus on the Specflow, the solution that can be used to implement BDD in our framework. We can use the Gherkin language as mentioned above and bind the steps definitions for desktop applications. If you haven’t yet installed Specflow, you can easily do so by using the NuGet manager in any Visual Studio project.

@Demo 
Scenario: Notepad Demo
 Given Launch Notepad 
 When Enter Specified Text
 Then Verify the Entered Text

Inspectors

When it comes to web automation, we can find different locators by inspecting the webpage. But that will not be possible when it comes to desktop app automation. That is why knowing how to use a UI Inspector is a crucial part of learning how to automate a desktop application using C#.

Inspectors used for Desktop Applications:

  • FlaUInspect
  • UIspy
  • Inspect
  • VisualUIAVerify

Using either one of these UI inspectors, you’ll be able to see the DOM of the desktop application and get the locators of elements such as ID, Name, ClassName, XPath, and so on.

How to Automate a Desktop Application using C#?

First up, we’ll need to create a new project in Visual Studio using the Console App (.NET Framework)

Create a new project to automate a Dektop application

Install Specflow

We have to then install and set Specflow up by

  • Navigating to Project > Manage NuGet Packages
  • Search for Specflow and click on Specflow to install it
  • We have to then add Specflow.NUnit and Specflow.Tools.MsBuild.Generation from the same NuGet packages

Installing Specflow

Installing WinAppDriver

We need to install WinAppDriver from GitHub to launch and access the desktop application we wish to automate. WinAppDriver will create a bridge for the application and our tests. You’ll have to enable the developer mode in Windows to run WinAppDriver.

To access the WinAppDriver classes and methods, we need to add Appium.Webdriver to our project from NuGet packages

Installing WinAppDriver to automate a desktop Application using C#

The next step would be to Create a Feature file. You can do so by right-clicking on the Feature folder > Add > New item > Search for Feature File for Specflow as shown in the below image.

Creating a feature file in WinAppDriver

Framework Setup

Now that everything is installed and ready, we’ll be seeing how to set up the framework in our How to automate a desktop application using C# blog. You’ll have to,

Create a windowsUtils Class file

Taking screenshots during test execution and generating reports is an integral part of knowing how to automate a desktop application using C#. And you’ll need the windowsUtils class file to achieve that.

public class windowsUtils
    {
        static WindowsDriver<WindowsElement> window;
        static windowsUtils()
        {
         window = LaunchApp("C:\\ProgramData\\Microsoft\\Windows\\Start        Menu\\Programs\\Accessories\\Notepad.lnk");
        }
        public static WindowsDriver<WindowsElement> getWindowInstance()
        {
            return window;
        }
        public static WindowsDriver<WindowsElement> LaunchApp(String _ApplicationLocation)
        {
            try
            {
                AppiumOptions options = new AppiumOptions();
                options.AddAdditionalCapability("app", _ApplicationLocation);
                options.AddAdditionalCapability("deviceName", "WindowsPc");
                window = new WindowsDriver<WindowsElement>(new    Uri("http://127.0.0.1:4723/"), options);

            }
            catch (Exception ex)
            return window;
        }
Create a class file for the Base window

We’ll next have to use WinAppDriver to perform Desktop App Automation testing. So we have mentioned the code you’ll need to use to create the class file for the Base window.

public class baseWindow
    {
        public WindowsDriver<WindowsElement> window;
        public baseWindow(WindowsDriver<WindowsElement> window)
        {
            this.window = window;
        }
        public WindowsDriver<WindowsElement> getWindowInstance(String _ApplicationLocation)
        {
            try
            {
                AppiumOptions options = new AppiumOptions();
                options.AddAdditionalCapability("app", "C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Accessories\\Notepad.lnk");
                options.AddAdditionalCapability("deviceName", "WindowsPc");
                window = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723/"), options);
            }
            catch (Exception ex)
            return window;
        }
Create a class file for the Methods

We then create a class for the methods to perform the required action in the desktop application. In our case, we have chosen Notepad. And we will be entering the word “Codoid Innovations” and validating if the specified text has been displayed.

public class Notepad : baseWindow
    {
        static WindowsDriver<WindowsElement> _window;
        public Notepad(WindowsDriver<WindowsElement> window) : base(window)
        {
            _window = this.window; 
        }
        public By Text => By.Name("Text Editor");
        public By Verifyinput => By.Name("Text Editor");
        public void Maximize()
        {
          window.Manage().Window.Maximize();
        }
        public void enterText()
        {
            window.FindElement(Text).SendKeys("Codoid Innovations");
        }
        public bool VerifytheText()
        {
            bool result = window.FindElement(Verifyinput).Displayed;
            return result;
        }
}
Run the Test

Finally, we can run the test by opening the command prompt from the file location and using the following command

“nunit3-console.exe filename –where “cat==tagname from the feature file””

C: \Demo\DemoAutomation\DemoAutomation\bin\Debug>nunit3-console.exe DemoAutomation.dll --where "cat==Demo"

Note: Based on your requirements, you can either add Extent report or Allure report from the nuget packages.

Conclusion

We hope you now have a clear picture of how to automate a desktop application using C# after reading our blog. As a pioneer automation testing company, we have even developed our very own desktop app automation tool called Gyra. If you are unfamiliar with C#, give Gyra a try as it is a free tool that works with Java. We will be publishing more informative content on our website, and we recommend you subscribe to our newsletter to not miss out on any of those content.

Desktop App Automation Testing using Python

Desktop App Automation Testing using Python

In this blog article, you will learn Desktop app automation testing using Python. Automating a desktop app is not an easy task using open-source tools. In the past, we wrote many blog articles on how to automate desktop applications test cases using White Framework.

However, today we would like to show you how to automate a desktop app using Python.

Required Packages

To automate desktop app, we need the following packages (pyWin32, comtypes, & six). Use the below Pip command to install all the three packages.

pip install pywinauto  

Launching An Application

from pywinauto.application import Application
app = Application().start("notepad.exe")
  

Inspecting Elements

You can use anyone of the below listed inspecting tools to write locators.

  • AccEvent.exe
  • AccExplorer32.exe
  • Inspect.exe
  • SPYXX.EXE
  • swapy-ob-0.4.3.exe
  • UISpy.exe
  • ViewWizard.exe
  • WSEdit.EXE

Locating windows by title

app.window(title="Untitled - Notepad").menu_select("Help->About Notepad")
  

Locating with regular expression

app.window(title_re='.* - Notepad$')
  

Finding a window with multiple properties

window = findwindow(title = "Untitled - Notepad", class = "Notepad")

Print Identifiers

Use the below command to print all the identifiers on a window.

app.window(title="Untitled - Notepad").print_control_identifiers()  

Other Actions

app.UntitledNotepad.menu_select("File->SaveAs")
app.SaveAs.ComboBox5.select("UTF-8")
app.SaveAs.edit1.set_text("Example-utf8.txt")
app.SaveAs.Save.click()
  

We explored this library with excitement. Desktop app automation testing using Python library is more user-friendly and the execution is also much faster than other implementations.

How to automate desktop application test cases

How to automate desktop application test cases

Automating desktop app test cases using open source tools is an herculean task. It requires complete understanding of your application’s technology and in-depth knowledge of how your OS interacts with desktop applications. For example: If you are automating a Windows desktop application, you should be aware of how Windows Event-driven programming interacts with your application. In this blog article, we will see most of the technical information based on Windows application.

Technologies for windows desktop app development

Knowing the technologies for Windows desktop app development is a key information to decide a right automation tool. If you take any Windows based desktop application, it must have been developed using the following package/framework Windows API, MFC (Microsoft Foundation Classes), and .NET. When you choose a test automation tool, just check whether these technologies are supported.

How to automate desktop application test cases

How Windows Works

Consider your software under test is developed using Windows API. Each application window is assigned with Window Handle (hwnd). Once the user depresses the left mouse button on the application window, then Windows OS will construct a message and send it to the designated window using hwnd.

Automating Windows Desktop Application

From our experience, we recommend the following libraries (White Framework, FlaUI, .NET UI Automation, and Win32 Library for .net) to automate desktop applications. Choosing a tool is a cakewalk. However, selecting an unique identifier to locate a Windows object is tricky. Automating Desktop application test cases using coordinates is not a good idea. You always need to write robust locators to achieve consistency in automated script execution. Use Object Spy, understand the underlying technology, and perform trail & error method to construct valid object locators.

Automating Windows Desktop Application

In Conclusion:

Don’t automate Desktop Application Test suite without doing a POC. Make sure you engage a test automation architect who has vast experience in automating Desktop, Web, and Mobile applications.

All about Desktop Application Testing

All about Desktop Application Testing

Desktop applications require a human to run them and work separately as full-function programs and independently of all other applications. Adequate and proper hardware and a set of functions are required for accurate desktop application testing. This testing is complex and intricate since most are developed for a particular environment, and hence interaction with other factors is nil. In addition, a number of computer systems with varying configurations are required for this type of testing, but the tester has the ability to completely control the application under test.

Understanding Desktop Applications

Specific environments act as the model or starting point of a test plan. It is possible to test an application under classifications such as load, functionality, GUI, and more, and since desktop applications are normally in use by a single user at a given point, it must be installed as an exe file.

There is of course a significant rise in mobile and handheld device technology, but desktops are still used, and hence businesses must ensure that the applications for such systems are ready to function when installed. It is necessary that desktop applications are not ignored and made part of QA programs and any top quality QA Outsourcing company will understand the importance of such applications and will ensure that your business has the best.

Just as with any applications and systems, desktop applications need deft management since if poorly running and defective, they can negatively impact business, increase costs, and lead to a severe dent in the reputation of a company.

Running desktop applications is about testing applications on personal computers, desktop computers, and other such devices, and testing is run to check functionality, security, usability, stability, and more. If companies have the resources both money and human, to invest in this type of testing it would make sense to have an in-house team. However, since such testing has stringent deadlines and requires a high level of quality control, most businesses may find themselves incompetent to deal with it. It would make more business sense to outsource this function to a top quality QA testing company, capable of delivering more for every resource invested. Such a company would not only help to bring down costs and overheads of managing such tests, but would also ensure that the software remains efficient and speedy across all the stages.

Common Errors in Desktop Applications

The kind of errors in desktop application is different to other applications, which is why they require professionals to manage them.

  • 1. Inaccurate and unauthorized features auto installed by the application, without input from the user
  • 2. Wrong shortcut icon
  • 3. Issues related to dependence on platform
  • 4. Background running of a process even post uninstallation of application
  • 5. Incorrect warning / error messages
  • 6. Unauthorized access to users to even restricted applications

A Checklist for Desktop Application Testing is Necessary

Anyone excelling in the realm of testing would know that a checklist is quintessential when writing test cases, and in the case of desktop applications too such a checklist would help to create a high number of test cases. The testing checklist should include the following tests:

  • 1. Testing GUI or Graphical User Interface
  • 2. Functional Testing
  • 3. Performance testing under normal and load conditions
  • 4. Compatibility Testing

There are several tools that are part of industry practice to assist with desktop application testing. A highly seasoned software testing company would have the latest tools, technology, and methodologies for this purpose. The tools include a variety of regression testing and stress testing tools. Such a company would also understand that since there are some key differences between web applications and desktop applications, their handling and testing would also be different and must be managed as so.

In Conclusion:

The ownership, responsibility and accountability of a desktop application tester are very different to that of a web or client server applications tester. Understanding these differences proves critical to ensure that product quality is of the highest order and a highly expert team of desktop application testers would always remain on point. Connect with us to access the best in class team of experts.