Skip to content

The Challenge of Electron Testing

Anna Thorsen

Anna Thorsen

Electron is a popular choice for businesses looking for easy solutions to build native desktop applications. However, it is not straightforward to test.

In this blog post, we’ll explain why businesses use it, and the challenges to avoid when testing Electron.

What is Electron?

Electron is used by companies to build cross-platform (i.e. Linux, Mac, and Windows) desktop applications. It’s a free and open-sourced framework developed and maintained by GitHub.

It provides a framework for building “native applications with web technologies like Javascript, HTML, and CSS.

Examples of popular applications built with Electron include Whatapp’s, Zoom, and Twitch.

Why do organizations use Electron?

Electron is used by thousands of organizations due to its ability to provide services across different platforms. Typically, they are applications that use microphones, webcams, and other desktop elements that are not directly available via the browser unless user consent is given. This makes for a bad user experience. Electron changes that.

So how does Electron do this?

Electron enables organizations to build cross-platform/hybrid desktop applications using web technologies. Microsoft Teams (both the desktop and browser versions) is an example of an application built on Electron due to its ability to streamline the delivery process and keep development to a minimum.

This is because they use JavaScript, a more user-friendly programming language compared to C or C++. This helps businesses speed up development with less maintenance as developers work with one codebase, rather than many.

Challenges of testing Electron applications

While it is simpler to build desktop applications using Electron, their one code base does not remove the need for testing. Testing electron (on the UI, as opposed to unit testing) comes with its own set of challenges, whether it is done manually or with automation.

Manually testing Electron

While Electron is a modern approach to application development, testing hasn’t kept up. According to the 2021-2022 World Quality Report, 85% of testing is still manual.

Manually testing your applications built on Electron is a slow approach and leads to low test coverage. The result? New capabilities take longer to release and, in the worst case, undiscovered bugs make it to a production environment.

The larger the organization, the more likely this approach will fail as the need for software regression testing will grow.

Given the reasons mentioned above, slow manual testing has led to a shift in approach, with businesses adopting test automation with varying degrees of success.

Test automation across web and desktop

Electron makes for a unique case in testing. It merges web and desktop technologies making it somewhat challenging to automate.

Selenium, a popular open-sourced test automation tool, cannot be used in this instance as it is only able to automate testing on web applications. This means an alternative tool or framework has to be used. The good news is, there are solutions that enable businesses to automate across the web and desktop all in one place.

Code or no code automation for Electron?

There are different approaches to test automation, from code-based/low-code commercial solutions and self-built frameworks, to entirely visual codeless test automation. Some are more effective than others, and their success (in part) depends on the requirements your team have, and the resources you have available.

To learn more about the differences between code and no code automation, and the differences between commercial tools and self-built frameworks, check our post on Testing Electron Apps: How to Automate Testing, or download our whitepaper on How to Find an Agile Test Automation Tool.

New call-to-action