Skip to main content
Use a persistent browser context when browser state should live in a real user data directory.
import { flow } from "@qawolf/flows/web";

export default flow(
  "Use saved profile",
  {
    target: "Web - Chrome",
    launch: {
      browserContext: "persistent",
      userDataDir: "/tmp/qawolf-profile",
    },
  },
  async ({ page }) => {
    await page.goto("https://example.com/account");
  },
);
For the exact persistent-context launch shape, see the Web Reference.

When To Use It

  • the app stores login state in the browser profile
  • the test needs browser settings that persist after launch
  • the flow should reuse extension or profile data

Keep Profiles Isolated

Use a path unique to the run when flows may execute in parallel.
const userDataDir = `/tmp/qawolf-profile-${Date.now()}`;

export default flow(
  "Use isolated profile",
  {
    target: "Web - Chrome",
    launch: {
      browserContext: "persistent",
      userDataDir,
    },
  },
  async ({ page }) => {
    await page.goto("https://example.com/account");
  },
);
Last modified on April 24, 2026