Skip to main content
Use Electron launch mode when the target is a desktop app instead of a browser page.
import { flow } from "@qawolf/flows/web";

export default flow(
  "Open desktop app",
  {
    target: "Web - Chrome",
    launch: {
      kind: "electron",
      executablePath: "/Applications/MyApp.app/Contents/MacOS/MyApp",
    },
  },
  async ({ page }) => {
    await page.getByRole("button", { name: "Sign in" }).click();
  },
);
For the exact Electron launch shape, see the Web Reference.

Use The First Window

The Electron flow callback receives the first window as page.
await page.getByLabel("Email").fill("qa@example.com");
await page.getByRole("button", { name: "Continue" }).click();

Choose The Executable At Runtime

Call launch(...) manually when the app path depends on callback logic.
import { flow, launch } from "@qawolf/flows/web";

export default flow("Open desktop app", "Web - Chrome", async () => {
  const useCanary = process.env["USE_CANARY_APP"] === "true";

  const { firstWindowPage } = await launch({
    kind: "electron",
    executablePath: useCanary
      ? "/Applications/MyApp Canary.app/Contents/MacOS/MyApp"
      : "/Applications/MyApp.app/Contents/MacOS/MyApp",
  });

  await firstWindowPage.getByRole("button", { name: "Sign in" }).click();
});
Last modified on April 24, 2026