This video is a tutorial on a new feature in Playwright version 1.23.2 called network replay. The video starts with an introduction to the concept of HAR (HTTP Archive) files, which are used to track performance issues like bottlenecks and slow load times. The presenter demonstrates how to generate a HAR file using Chrome DevTools by inspecting the network tab and exporting the data. After that, they show how to use the HAR Analyzer from Google Apps to analyze the content of the HAR file and view details about the HTTP requests and responses.
The video then moves on to generating HAR files using Playwright. The presenter updates the Playwright version in their package.json file and runs the necessary commands to install the dependencies and update the browsers. They then show a simple script using Playwright to generate a HAR file by enabling network routing and specifying the file name and location.
After demonstrating how to generate a HAR file using Playwright, the presenter shows how to use the HAR file for network replay. They modify the script to set the update option to false, indicating that the HAR file should be used instead of making live requests. They then run the modified script, and Playwright loads the browser using the HAR file and performs the UI testing tasks specified in the script.
The presenter highlights the usefulness of HAR files for testing when the test environment or server is down. They mention that HAR files are particularly helpful when testing UI functionality that doesn't rely on external server responses, such as searching for books. However, they also mention that HAR files may not be beneficial for testing functionality that requires communication with external servers.
In conclusion, the video provides a comprehensive overview of generating and using HAR files with Playwright for network replay, showcasing the capabilities and potential benefits of this feature for UI testing.
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 firstname.lastname@example.org.