Rayrun
← Back to videos

Playwright tutorial 6 - How to generate playwright tests using codegen

#PlaywrightTests #CodegenTutorial #AutomatedTesting #WebTesting #PlaywrightFramework #TestAutomation #SoftwareTesting #TestingTutorial #CodeGeneration #PlaywrightCodegen #TestGeneration #QualityAssurance #QAEngineering #WebDevelopment #TestScripts #CodeTesting #TestSuite #TestingFramework #ProgrammingTutorial #SoftwareDevelopment #TestAutomationFramework

In this video, the presenter provides a detailed walkthrough on how to generate a test script using Playwright Codegen, a Node.js library that provides a convenient toolset for automating web browsing.

By running the npx playwright codegen command, a browser is opened where the user can start performing actions. As the user navigates the web and performs operations like searching or clicking, the corresponding code is simultaneously generated on Playwright Inspector located on the right side of the browser.

The video demonstrates this process through practical examples, such as performing a Google search. Every action performed in the browser is translated into code, which can be copied from the Inspector and optimized by removing unnecessary lines. Once generated, the code can be tested to ensure it works smoothly.

The presenter also shows how to use npx playwright codegen with different flags to carry out tasks like saving the generated script into a file with -o option, selecting a specific language for the generated script, specifying a particular browser to run the recording with -b, and more. The video even walks through how to emulate different devices and bypass proxies while recording the script.

The video ends with the presenter highlighting how easy it is to generate code using Playwright, and how it helps in efficiently creating an optimized script. This step-by-step guide makes it easier for developers to understand how to use the Playwright Codegen to automate web browsing for their applications.

Related Videos

Playwright Tutorial - NEW Locator.or() Method
Playwright Tutorial - NEW Locator.or() Method
Playwright - Set timeout, parallelisation and retries directly in your test files
Playwright - Set timeout, parallelisation and retries directly in your test files
Playwright locator API In Detail | Playwright Tutorial - Part 53
Playwright locator API In Detail | Playwright Tutorial - Part 53
Handling Select/DropDown | Playwright - Part 9
Handling Select/DropDown | Playwright - Part 9
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.