YoVDO

Playwright Beginner Tutorial - How to Record Tests

Offered By: Automation Step by Step via YouTube

Tags

Playwright Courses Software Testing Courses Code Generation Courses Test Automation Courses

Course Description

Overview

Learn how to record and generate automated tests using Playwright's Codegen tool in this comprehensive tutorial. Explore the Test Generator's capabilities, including opening browser windows, recording interactions, and generating test scripts. Master various command-line options to customize your test recording experience, such as specifying browsers, setting viewport sizes, emulating devices, and adjusting color schemes. Gain practical knowledge on saving and running recorded scripts, making this tutorial an essential resource for beginners looking to enhance their Playwright automation skills.

Syllabus

Intro
What is Codegen
Step 1 - Open terminal and run codegen *npx playwright codegen*
Step 2 - Check 2 windows open - Browser and Playwright Inspector
Step 3 - Record your test steps and check the test scripts getting created
Step 4 - Save the recorded script in a test file | Run and check
Can also add the url *npx playwright codegen google.com*
See all options *npx playwright codegen --help*
Screenshot moment
Record on a specific browser default:chromium *npx playwright codegen --browser firefox*
Record and save to a file *npx playwright codegen --target javascript -o record_example.js*
Set viewport - screen resolution size *npx playwright codegen --viewport-size=800,600*
Emulate devices *npx playwright codegen --device="iPhone 11"*
Emulate color scheme if available *npx playwright codegen --color-scheme=dark*
Screenshot moment


Taught by

Automation Step by Step

Related Courses

Amazon Q Introduction (Thai)
Amazon Web Services via AWS Skill Builder
Angular tooling: Generating code with schematics
Coursera Project Network via Coursera
AWS Flash - Chalk Talks: Amazon Q Developer
Amazon Web Services via AWS Skill Builder
AWS Flash - Generative AI in Action: Real-World Use Cases
Amazon Web Services via AWS Skill Builder
AWS Flash - Generative AI in Action: Real-World Use Cases (Simplified Chinese)
Amazon Web Services via AWS Skill Builder