How do I interrupt a running Playwright test?


Stopping a Running Test

To interrupt a running @playwright/test, use the keyboard shortcut Ctrl + C on Windows or Command + C on Mac. This sends an interrupt signal to the terminal, stopping the test execution. You can also close the terminal window or tab where the test is running.

Headless Mode

If you're running tests in headless mode (no browser window opens), stopping a test is as simple as using the keyboard shortcut or closing the terminal.

Headed Mode

If you're running tests in headed mode (a browser window opens), you have a couple of options:

  1. Click the "Stop" button at the top of your VS Code editor to stop the currently executing Playwright script.
  2. Close the browser window to terminate any running Playwright scripts.

Remember, the method to stop a running test depends on whether it's being run in headless or headed mode. In headless mode, use keyboard shortcuts or close the terminal, while in headed mode, click the "Stop" button in VS Code or close the browser window.

Thank you!
Was this helpful?
Still have questions?

If you still have questions, please ask a question and I will try to answer it.

AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.