Rayrun
← Back to videos

Playwright Capture Screenshots and Record Videos after test execution

This simple and easy to follow tutorial will guide you through how you can use playwright test to capture screenshots and record videos after test execution.

In this video, the presenter demonstrates how to record screenshots and videos using the Playwright testing framework after test execution. This can be beneficial when debugging tests, especially in continuous integration environments.

Here's a step-by-step summary of the key steps in the video:

  1. Set the video and screenshot properties in the test config file.
    • By using the use property in the test config file, you can set the video and screenshot options globally. These options can also be set for specific projects by using the use property within the project definition.
    • The video options include off, on, on first retry, retain on failure, and retry with video, while the screenshot options are off, on, and only on failure.
  2. Run the tests to produce videos, screenshots, or both upon failure or success based on the set options.
  3. Review the outputs, such as the test results folder, which contains the generated video and screenshots for each test.
    • Playwright automatically organizes the output files according to the test structure, including the project name, test name, and file name.
    • Review the updated HTML test report, which now includes the generated screenshot and video as attachments for each test.

In conclusion, Playwright simplifies the process of capturing videos and screenshots during test execution, providing useful debugging information for developers and testers alike. So, take the time to explore these capabilities and determine which options work best for your testing needs. And as always, if you have any questions or comments, feel free to drop them in the comments section of the video.

Related Videos

Playwright Tutorial: Output Console logs as step traces to UI watch Mode & Traceviewer
Playwright Tutorial: Output Console logs as step traces to UI watch Mode & Traceviewer
#16 - ARIA and how Playwright is making use of it to identify UI controls?
#16 - ARIA and how Playwright is making use of it to identify UI controls?
Playwright - Set timeout, parallelisation and retries directly in your test files
Playwright - Set timeout, parallelisation and retries directly in your test files
Playwright & Lighthouse Integration | Playwright Tutorial - Part 88
Playwright & Lighthouse Integration | Playwright Tutorial - Part 88
TwitterGitHubLinkedIn
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.