Tips and tricks Best practice guides, FAQ & more
Selenium has become a popular automation tool. It's open-sourced and free so it has become somewhat of a standard in automation. Naturally, people frequently ask the question “can Selenium be used to automate desktop applications?"
The simple answer is no.
Selenium testing is designed to automate web applications, not desktop applications. Automating desktop applications requires a different type of automation tool that's designed for desktop automation. That doesn't mean it's impossible though.
Leapwork is such a tool. You can find a comparison of Selenium and Leapwork, plus everything you need to know about what Selenium can and cannot automate in our whitepaper on codeless Selenium for desktop automation.
Related article: Tools for Faster Desktop Test Automation
There are partial workarounds, but you are not going to like them. Here’s why.
There are two technologies built right into Windows that are made to automate most types of desktop applications; a new UI Automation (UIA) technology and a legacy technology called MS Active Accessibility (MSAA).
While Selenium is considered by many programmers to have an attractive programming model and architecture, UIA and MSAA are both very complex, and they don't cover all types of desktop applications.
For instance, many Java-based desktop applications can only be partially automated with them. There are also major limitations for certain modern applications made with Windows Presentation Foundation (WPF).
If you're an experienced programmer or tester, you might have dabbled in projects using Selenium WebDriver architecture to build extensions for desktop technologies or to bridge the gap between Selenium and UIA or MSAA.
Here are a couple of links, with descriptions from the respective authors:
All these (and more) attempts at creating workarounds so that “Selenium-like code” can be used to automate desktop applications are either abandoned open source projects or narrowly targeted at specific use cases.
If you are a professional programmer looking to writing code to automate Windows desktop applications, UIA and MSAA are the only truly good starting points.
You’ll most likely have to write a lot of extension code on top of it, to make it fit with the application(s) you are looking to automate. However, there is another way.
Leapwork is a codeless automation platform that works with all popular desktop technologies and allows you to automate tests and processes across desktop and web applications.
Leapwork is powered by native object inspection that works for desktop applications based on all major frameworks. Test cases are built as flowcharts with building blocks, and you simply click UI elements to capture and define operations and flow.
With Leapwork you can:
Leapwork allows you to automate tests across technologies, from SAP and web to desktop and Citrix - and even 3D apps - within a single automation flow.
Watch the video to see how quickly and easily tests can be created in Leapwork compared to Selenium. The example here is web automation, but with Leapwork, it doesn't matter whether you are automating web or desktop - Leapwork moves seamlessly between them:
Sign up for our webinar on desktop automation or learn all about how Leapwork compares to Selenium in our whitepaper on codeless Selenium for desktop automation. In the whitepaper you will get: