To create a video from a Playwright trace, follow these steps:
Open the HTML report: Run npx playwright show-report
in your terminal or open the HTML file directly.
Access the trace: Click on the trace icon next to the test name file name or open the detailed view of the test and scroll down to the 'Traces' tab. Click on "Open Trace Viewer".
Navigate through the trace: Use the timeline to hover over each step or action in the trace. You can see the state of the page before and after each action.
Start recording: Click on the camera icon at the top right corner to start recording all actions performed during that time period.
import { test } from '@playwright/test';
test('Record video from trace', async ({ page }) => {
await page.goto('https://ray.run/');
// Your test actions here
});
Stop recording: Click on the camera icon again to stop recording.
Download the video: A download option will appear at the bottom right corner. Click on it to download the recorded video as a .webm
file, which is supported by most browsers.
By following these steps, you can easily create a video from a Playwright trace and share it with your stakeholders for better understanding of your test execution and results.
If you still have questions, please ask a question and I will try to answer it.
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 [email protected].