Electron App Testing End to End: Beyond Playwright's Electron Support

Electron app testing as the user sees it: what Playwright's Electron API covers, where it stops, and one test through the page, the file dialog and the toast.

10 min readBy Ait Nohaila, Business Development Representative

The short answer

To test an Electron app automatically, drive it like a user, native dialogs included, and check what it draws on the screen.

  • Playwright's Electron API covers the renderer and main process; the shell needs a tool that sees the screen.

This guide is for the developers and QA people of an Electron desktop app.It says what makes such an app different to test, gives a fair account of Playwright's Electron API, then shows one end-to-end test through the page, the native file dialog, an export and its notification, run on every build.

What makes an Electron app different to test

An Electron app is two programs working together.The main process runs in Node.js: it opens the windows, owns the app's life cycle, and asks the operating system for everything native, such as menus, dialogs and tray icons.Each window then runs a renderer process, which is a Chromium page: HTML, CSS and JavaScript, like a website.

File · Edit · View · Help
Native menu
The page (renderer)
Export
Open
invoice-2026.csv
Open
Native file dialog
Export finished
invoice-2026.pdf is ready
OS notification
Main process
Node.js: it opens the windows and asks Windows for the dialogs, menus, tray and notifications
System tray icon
Only the dashed part is a web page.The menu bar, the file dialog, the notification and the tray icon are drawn by Windows at the main process's request, and a user meets all of them.

For testing, this split matters.A tool made for websites sees the page and only the page.A user sees the whole thing: the menu bar, the Windows file dialog that opens on Open, the toast that says the export is finished, the icon that lives on in the tray after the window is closed.

That is where Electron apps break in ways a page-level test never sees.

  • The Save dialog opens on the wrong folder.
  • A menu item is greyed out after an update.
  • A second window opens behind the first.
  • A notification fires twice, or never.
  • Labels wrap on a 1366 pixel laptop.

What Playwright's Electron API covers, and where it stops

Among Electron UI testing tools, Playwright is the one most teams try first, because they already use it for their web app.Its Electron class is documented as experimental support, for Electron 21 and later.The test launches the app from its entry script, gets each window as a Playwright page, and runs code in the main process with evaluate().

That is a real reach into the app.Every locator, click and assertion Playwright offers on a web page works on the renderer, a second window arrives through the window event, and evaluate() can read or change the app's state.See the ElectronApplication class for the full list.

The stop is just as clearly documented.Native dialog calls such as dialog.showOpenDialog are not intercepted, because they go straight to the operating system, and the documentation advises replacing those methods from the test with a stub that returns the file path you want.The real dialog never opens, so it is never tested.The same holds for everything else the operating system draws outside the page.

What you testPlaywright's Electron APIA test of the screen, in GUI Test Studio
The page (the renderer)Every window is a page: locators, clicks, typing, assertions, screenshots.Clicks and keys as real input, and checks of what the page draws.
The main processevaluate() runs your code in it: read the app's state, stub a method.Not reached directly.What it does is checked where it shows: on the screen.
Native file and message dialogsNot intercepted, by its own documentation: the test replaces the dialog call with a stub.The real Windows dialog is part of the test: recorded, driven, checked.
The system tray and native menusNo call of its own.A menu item's handler can be run from evaluate(), without the click.Clicked where they are drawn, by sight, as the user clicks them.
OS notificationsNo call reads what Windows drew.The test can check the code that asked for one.A Text Assert waits for the toast's words on the screen.
A second windowEach window is a page, through the window event or windows().Any window on the screen, the dialog over it included.
What the user seesA screenshot of a window's page, which the test can compare with a stored one.The whole screen is recorded, and every check compares what is drawn.

Facts read on Playwright's documentation on 6 November 2026.Playwright and Electron are trademarks of their respective owners; this guide is not affiliated with or endorsed by them.

A stubbed dialog proves the app handles a file path.Only the real dialog proves the user can pick the file.

One end-to-end test across the renderer and the shell

Here is how to test an Electron app end to end in GUI Test Studio, with an invoicing app as the example: open a file through the native dialog, edit a line, export a PDF, and check the notification that says it is done.

  1. 1

    Record the app, not the page

    In GUI Test Runner-Recorder, click Record and pick An app.Choose your Electron app, or browse to its executable, and tick the box that starts it with the test and closes it at the end, so every run begins from a fresh app.Then use it as a user would.

    The whole screen is always recorded.Choosing the app only decides where the automatic checks come from.
  2. 2

    Open a file through the real dialog

    Click Open.The Windows file dialog is a window like any other to the recording: type the file's path into the file name field and press Enter, and both are recorded as real input.A check of the dialog is recorded before the click, so the run waits until it is really up.

    Many Electron apps are also served as a web page.For that version of the same screens, the Upload File step hands the file to the page without any dialog.

  3. 3

    Edit, export, and read the toast

    Change a quantity, click Export.When the notification appears, let it stand a moment before you stop: the recording notes what appeared, and the test gets a check of it.

  4. 4

    Say what the test must verify

    When you stop, GUI Test Runner-Recorder asks what the test should verify: the elements you clicked, the texts, and what appeared on the screen.Keep the three on.Every step is then a block on the timeline in GUI Test Studio, and nothing in it names a process.

One recording, five moments, three places

  1. ShellRun AppStarts the app fresh
  2. PageClick OpenVisual Assert on the button
  3. DialogType the file name, EnterText Assert: the dialog is up
  4. PageEdit, then ExportText Assert on the total
  5. DesktopThe notificationText Assert: Export finished
The test does not know which process drew what.It sees one screen, as the user does, and checks it at every moment that matters.

The checks that matter: text, visual, layout

A recording gives the test the checks that aim its clicks.The ones worth adding by hand catch what an Electron app breaks most often.

Text Assert

A Text Assert waits for words: the dialog's title, the total after the edit, Export finished in the toast, and a Dynamic Text Assert accepts a value of a known shape, such as today's date in a file name.

Visual Assert

A Visual Assert compares a picture: the Export button, the icon in the tray, the menu item that must not be greyed out.

Layout Assert

A Layout Assert checks that the elements of a screen still stand where they should, which catches a window that opened behind another or a label that wrapped on a smaller screen.

Every comparison ignores the rendering noise two runs always have, a shade lighter here, a softer edge there, and still catches the real regressions a person would call a change: a missing icon, a changed word, a button in the wrong colour.See Visual checks for how strict each check is.

Two habits make an Electron test hold up.

  • Check the outcome, not only the clicks: the total on the screen, the notification's words.
  • Give the native pieces their own check: the dialog's title before typing into it, the menu item before clicking it.

The Confidence Report then says, for every check, whether the element was found and whether it looks as recorded, with the expected and found pictures side by side.For a desktop app whose controls Windows cannot describe, the same approach works by sight alone: see testing Windows apps with no accessibility tree.

Electron automated testing on every build

gtr-cli, the command-line runner, runs the test exactly like the Run Test button, and adds what a pipeline needs: an exit code, a JUnit file, and every piece of evidence of a failure in one folder.

The Electron tests on every build
gtr-cli run tests\electron --countdown 0 --junit results\junit.xml --artifacts results\artifacts

The Run App step at the start of the test launches the build under test: point it at the packaged executable the build made, and the same test checks every version you ship.The build agent needs a signed-in, unlocked Windows desktop session, because the app draws on a real screen.The CI/CD guide sets it up for TeamCity, Jenkins, GitHub Actions, GitLab and Azure DevOps.

The Run App step: the program to start, its arguments, and when the test goes on.

One thing does not apply here.GUI Test Studio's Browsers & Devices make versions of a web test for Chrome, Edge, Firefox and emulated phones, as cross-browser testing explains.An Electron app ships its own Chromium, so there is one browser to test, and the versions that matter are your builds.

The build runs

gtr-cli starts the packaged app

The journey replays

Page, dialog, export, toast

Confidence Report

Regression or noise, with pictures

Ship, or fix first

A failed check fails the build

When Playwright's Electron API is still the right tool

A fair guide says where the other tool wins, and here it does.Playwright's Electron API is the right choice for code-level tests of the main process: evaluate() reads the app's state directly, a stubbed dialog makes a test of the file handling fast and exact, and none of it needs a screen.A team that already writes Playwright tests for its web app keeps its locators and habits in the renderer, and runs those tests in seconds on every pull request.

The two are not rivals.Keep Playwright for the renderer and the main process, and a test of the screen for the journey a user takes through the shell: the real dialog, the real menu, the real notification, on the real build.Each catches what the other cannot see.

Key takeaways

  • 1An Electron app is a page plus a shell: the main process owns the dialogs, menus, tray and notifications, and a user meets all of them.
  • 2Playwright's Electron API reaches the page and the main process from code, and its own documentation says native dialogs are not intercepted.
  • 3GUI Test Studio tests the app as the user sees it: the whole screen recorded, the real file dialog driven like any window, no test build and no plugin.
  • 4Text, Visual and Layout Asserts catch what breaks: a wrong total, a missing icon, a greyed-out menu item, a window behind another.
  • 5The same test runs on every build with gtr-cli, with a JUnit file for the pipeline; Browsers & Devices are for web pages, your builds are the versions here.

Questions

How do you test an Electron app automatically?

Drive it the way a user does: start the app, click and type in its windows, open its native dialogs, and check what is drawn on the screen.GUI Test Studio records that journey once and replays it on every build, with no test code.Playwright's Electron API is the way in from code, for the page and the main process.

Does Playwright support Electron?

Yes, as an experimental feature.Playwright's Electron class launches an Electron app from code, gives you each of its windows as a page, and runs code in the main process.Its documentation names Electron version 21 and later.

Can Playwright test native dialogs in an Electron app?

Not as the user sees them.Playwright's documentation says it does not intercept native dialog calls such as dialog.showOpenDialog, and recommends replacing those methods from the test.A test that must open the real file dialog needs a tool that drives the screen.

How do you test the file open and save dialogs of an Electron app?

Record them.In GUI Test Studio the Windows file dialog is a window like any other: the click on Open, the file name typed and the Enter key are recorded and replayed as real input, and a check before the click makes sure the dialog is there.When the same screens are served as a web page, the Upload File step hands the file over without any dialog.

Can you test the system tray and notifications of an Electron app?

Yes, when the test sees the screen.A tray icon and a notification are drawn by Windows outside the app's window, so a test that only reaches the page cannot see them.GUI Test Studio records the whole screen: a click on the tray icon is a click, and a Text Assert waits for the notification's words.

Does GUI Test Studio need a test build or a plugin inside the Electron app?

No.Nothing is added to the app: GUI Test Studio watches the screen, uses the mouse and keyboard like a person, and asks Windows what the app already describes.The build you test is the build you ship.

Can Electron app tests run in a CI/CD pipeline?

Yes. gtr-cli runs the same test on a Windows build agent with an unlocked desktop session, fails the build when a check fails, and writes a JUnit file for the test tab of TeamCity, Jenkins, GitHub Actions, GitLab or Azure DevOps.

Should I use Playwright or GUI Test Studio for my Electron app?

Use Playwright's Electron API for fast, code-level tests of the page and the main process, especially if your team already writes Playwright tests.Use GUI Test Studio for the end-to-end journey as the user sees it, native dialogs, tray and notifications included, with no test code.Both can live side by side.

Electron, Playwright, Chromium, Node.js, Windows, TeamCity, Jenkins, GitHub, GitLab and Azure DevOps are trademarks of their respective owners.

Ready to record your first test?

Every feature, for 15 days.

Rather see it on the kind of app you test?Book a free 30-minute call with our team.

Book a demo