Playwright Python and Pytest for Web Automation Testing
Keep adding new skills with 10,000+ programs for $239 (usually $399). Save now.
Playwright Python and Pytest for Web Automation Testing
4,057 already enrolled
Included with
Ask Coursera
21 reviews
Recommended experience
21 reviews
Recommended experience
What you'll learn
Set up and utilize Playwright for seamless browser automation.
Master Pytest for writing modular and data-driven tests.
Integrate CI/CD pipelines with Playwright and GitHub Actions.
Implement behavior-driven testing (BDD) for comprehensive test coverage.
Skills you'll gain
Tools you'll learn
Details to know
See how employees at top companies are mastering in-demand skills
There are 21 modules in this course
Updated in May 2025.
This course now features Coursera Coach! A smarter way to learn with interactive, real-time conversations that help you test your knowledge, challenge assumptions, and deepen your understanding as you progress through the course. Unlock the full potential of web automation testing with Playwright and Pytest in this comprehensive course. From setting up Playwright to mastering advanced testing techniques, you’ll gain hands-on experience in building robust, maintainable test automation frameworks. Learn to write efficient tests, handle complex user interactions, and implement data-driven and behavior-driven testing seamlessly. The journey begins with an introduction to Playwright and its powerful features. Explore browser automation, locators, and key actions that form the foundation of your testing toolkit. Next, dive into advanced topics such as authentication, event handling, and UI testing. Each module is crafted to provide practical insights, empowering you to tackle real-world challenges. In the later modules, discover the integration of Pytest with Playwright, enabling efficient and modular testing workflows. Learn about CI/CD practices, GitHub API interactions, and optimization techniques to accelerate your automation process. Detailed video tutorials and practical examples ensure a smooth learning curve. This course is ideal for developers, testers, and QA professionals looking to enhance their web automation expertise. With no strict prerequisites, a basic understanding of Python is sufficient to start. Join us and transform your testing capabilities today!
In this module, we will introduce the foundational aspects of Playwright, including installation, accessing its documentation, and performing basic browser operations. By the end, you'll have a running setup and an understanding of how Playwright scripts are structured.
What's included
5 videos1 reading1 assignment
5 videos•Total 20 minutes
- Playwright Installation•5 minutes
- Playwright Docs•2 minutes
- Launching Browser•7 minutes
- Clicking Link Element•4 minutes
- Script Overview•2 minutes
1 reading•Total 10 minutes
- Full Course Resources•10 minutes
1 assignment•Total 15 minutes
- Getting Started - Assessment•15 minutes
In this module, we will dive into locators—the backbone of web element interactions in Playwright. From basic locators to CSS selectors and XPath, you’ll learn a variety of techniques to accurately identify and work with web elements.
What's included
12 videos1 assignment
12 videos•Total 81 minutes
- Playwright Python REPL•9 minutes
- Locator Role•8 minutes
- Locators Input Field•4 minutes
- Locator Text•4 minutes
- Locator Alt Text•2 minutes
- Locator Title•2 minutes
- Locating with CSS Selectors•10 minutes
- CSS Selectors Hierarchy•8 minutes
- CSS Selectors Pseudo Classes•9 minutes
- Locators XPath•6 minutes
- XPath Functions•7 minutes
- Other Locators•11 minutes
1 assignment•Total 15 minutes
- Locators - Assessment•15 minutes
In this module, we will explore how to perform various actions in a browser using Playwright. From mouse actions to keyboard shortcuts, you'll learn to simulate user behaviors and interact with dynamic web components.
What's included
7 videos1 assignment
7 videos•Total 34 minutes
- Mouse Actions•7 minutes
- Actions Text Input•6 minutes
- Radios, Checkboxes, and Switches•6 minutes
- Select Option•3 minutes
- Dropdown Menu•4 minutes
- Upload Files•5 minutes
- Keyboard Shortcuts•4 minutes
1 assignment•Total 15 minutes
- Actions - Assessment•15 minutes
In this module, we will focus on managing events and synchronization in Playwright. Learn to handle complex scenarios like auto-waiting, dialogs, and asynchronous operations to ensure robust test execution.
What's included
8 videos1 assignment
8 videos•Total 52 minutes
- Playwright Auto-Waiting•8 minutes
- Auto-Waiting Navigation•9 minutes
- Custom Waiting•6 minutes
- Event Listeners•8 minutes
- Handling Dialogs•6 minutes
- Download Files•5 minutes
- What Is Sync and Async?•3 minutes
- Asynchronous Playwright•7 minutes
1 assignment•Total 15 minutes
- Events - Assessment•15 minutes
In this module, we will tackle authentication workflows in Playwright. You’ll learn to handle sign-ins, save session states, and reuse them for seamless and secure automation across test cases.
What's included
4 videos1 assignment
4 videos•Total 20 minutes
- Google Sign In•9 minutes
- Save Authentication State•8 minutes
- Reuse Auth State•2 minutes
- Google Login Issue•1 minute
1 assignment•Total 15 minutes
- Authentication - Assessment•15 minutes
In this module, we will guide you through building an automated mail checker using Playwright. Learn how to locate emails, extract data, and process them directly from the terminal for robust email automation.
What's included
6 videos1 assignment
6 videos•Total 33 minutes
- Automatic Mail Checker•1 minute
- Project Setup•2 minutes
- Locate New Emails•9 minutes
- Locate Email Data•4 minutes
- Combine Locators•7 minutes
- Check Email from Terminal•10 minutes
1 assignment•Total 15 minutes
- Automated Mail Checker - Assessment•15 minutes
In this module, we will integrate Pytest into Playwright testing workflows. Discover how to write, run, and manage tests efficiently while leveraging Pytest's powerful features like fixtures and state management.
What's included
8 videos1 assignment
8 videos•Total 30 minutes
- Testing Pytest•2 minutes
- Writing Test•4 minutes
- Running Test•5 minutes
- Type Hinting•5 minutes
- Test State•4 minutes
- Pytest Fixture•2 minutes
- Using Fixture•5 minutes
- Fixture Scope•4 minutes
1 assignment•Total 15 minutes
- Pytest - Assessment•15 minutes
In this module, we will explore the pytest-playwright plugin, which bridges Pytest and Playwright for seamless testing. Learn how to configure the plugin, write tests, and utilize hooks to enhance your testing setup.
What's included
5 videos1 assignment
5 videos•Total 22 minutes
- Install pytest-playwright Plugin•3 minutes
- Playwright Test•5 minutes
- Running Test•3 minutes
- Pytest Config•3 minutes
- Test Hook•8 minutes
1 assignment•Total 15 minutes
- pytest-playwright Plugin - Assessment•15 minutes
In this module, we will delve into the various tools Playwright offers to enhance your automation testing experience. From debugging with trace viewers to capturing test evidence, you'll maximize your test efficiency.
What's included
4 videos1 assignment
4 videos•Total 21 minutes
- Take Screenshot•4 minutes
- Record Video•5 minutes
- Trace Generator and Viewer•8 minutes
- Playwright Codegen•4 minutes
1 assignment•Total 15 minutes
- Playwright Tools - Assessment•15 minutes
In this module, we will focus on web-first assertions in Playwright. Learn to validate element properties, states, and UI behaviors with precision, ensuring your tests cover all functional aspects.
What's included
7 videos1 assignment
7 videos•Total 26 minutes
- Assertions Page•3 minutes
- Assertions Element State•4 minutes
- Assertions Element Text•4 minutes
- Assertions Attribute•5 minutes
- Assertions Input Field•5 minutes
- Assertions Checkbox•2 minutes
- Assertions Option Menu•3 minutes
1 assignment•Total 15 minutes
- Web-First Assertions - Assessment•15 minutes
In this module, we will explore Playwright's capabilities in the UI Testing Playground. You'll tackle real-world challenges such as handling dynamic IDs, Ajax requests, and visibility checks, strengthening your UI testing skills.
What's included
16 videos1 assignment
16 videos•Total 66 minutes
- UI Testing Dynamic ID•3 minutes
- UI Testing Class Attribute•3 minutes
- UI Testing Hidden Layer•5 minutes
- UI testing Load Delay•3 minutes
- UI Testing Ajax Request•2 minutes
- UI Testing Click Action•2 minutes
- UI Testing Input Field•3 minutes
- UI Testing Scrollbars•3 minutes
- UI Testing Dynamic Table•10 minutes
- UI Testing Verify Text•2 minutes
- UI Testing Progress Bar•5 minutes
- UI Testing Visibility•7 minutes
- UI Testing App Login•6 minutes
- UI Testing Mouse Hover•4 minutes
- UI Testing NBSP Character•2 minutes
- UI Testing Overlapped•5 minutes
1 assignment•Total 15 minutes
- UI Testing Playground - Assessment•15 minutes
In this module, we will discuss Playwright fixtures and their role in organizing test code. Learn to customize browser contexts and leverage function and session-scoped fixtures for efficient testing.
What's included
4 videos1 assignment
4 videos•Total 15 minutes
- Function Scope Fixtures•2 minutes
- Session Scope Fixtures•4 minutes
- Browser Selection•3 minutes
- Browser Launch and Context Arguments•6 minutes
1 assignment•Total 15 minutes
- Playwright Fixtures - Assessment•15 minutes
In this module, we will introduce the Page Object Model (POM) for UI testing. Discover how to organize test scripts, improve maintainability, and reduce duplication using POM concepts and Playwright.
What's included
5 videos1 assignment
5 videos•Total 20 minutes
- What Is Page Object Model?•4 minutes
- Page Object Model Implementation•3 minutes
- Page Object Model Usage•2 minutes
- Playwright Homepage POM•6 minutes
- POM Usage•6 minutes
1 assignment•Total 15 minutes
- Page Object Model (POM) - Assessment•15 minutes
In this module, we will explore Playwright's capabilities in handling network events. Learn to manage requests, modify responses, and test network-dependent functionalities effectively.
What's included
3 videos1 assignment
3 videos•Total 18 minutes
- Network Events•3 minutes
- Handle Requests•10 minutes
- Modify Response•5 minutes
1 assignment•Total 15 minutes
- Network Events - Assessment•15 minutes
In this module, we will demonstrate how to use Playwright for API testing. From making API calls to mocking data, you’ll learn to integrate API tests seamlessly into your automation workflows.
What's included
5 videos1 assignment
5 videos•Total 31 minutes
- Making an API Call•5 minutes
- API Request Context•4 minutes
- API Query String•7 minutes
- CRUD Operations•11 minutes
- Mock API•5 minutes
1 assignment•Total 15 minutes
- API Testing - Assessment•15 minutes
In this module, we will focus on optimizing Playwright tests. Learn techniques like request interception, JavaScript disabling, and parallel execution to enhance test efficiency and coverage.
What's included
3 videos1 assignment
3 videos•Total 15 minutes
- Intercept Requests•7 minutes
- Disabling JavaScript•4 minutes
- Run Tests in Parallel•4 minutes
1 assignment•Total 15 minutes
- Optimization - Assessment•15 minutes
In this module, we will share valuable tips and tricks to improve your Playwright testing. From command-line arguments to debugging and device emulation, you’ll learn techniques to boost productivity.
What's included
5 videos1 assignment
5 videos•Total 20 minutes
- Pytest CLI Arguments•6 minutes
- Python Debugger•4 minutes
- Device Emulation•4 minutes
- Evaluate JavaScript•4 minutes
- Generate Reports•3 minutes
1 assignment•Total 15 minutes
- Tips and Tricks - Assessment•15 minutes
In this module, we will combine Playwright with GitHub API for testing and automation. Learn how to authenticate, make calls, and write tests for GitHub workflows effectively.
What's included
6 videos1 assignment
6 videos•Total 30 minutes
- GitHub API Introduction•1 minute
- Project Setup•6 minutes
- GitHub Token•4 minutes
- Authorized API Context•7 minutes
- Writing Tests•11 minutes
- Running Tests•2 minutes
1 assignment•Total 15 minutes
- GitHub API - Assessment•15 minutes
In this module, we will explore how to integrate Playwright with continuous integration tools. From repository setup to automated testing, you’ll ensure seamless CI workflows for your projects.
What's included
5 videos1 assignment
5 videos•Total 26 minutes
- GitHub CI Introduction•1 minute
- Setup Repository•4 minutes
- Writing Tests•7 minutes
- GitHub Action•10 minutes
- Running Automated Tests•5 minutes
1 assignment•Total 15 minutes
- Continuous Integration (CI) - Assessment•15 minutes
In this module, we will focus on data-driven testing with Playwright and Pytest. Discover how to handle diverse input scenarios efficiently using parameterization.
What's included
3 videos1 assignment
3 videos•Total 7 minutes
- What Is Data-Driven Testing?•1 minute
- Pytest Parametrize•4 minutes
- Running Test•2 minutes
1 assignment•Total 15 minutes
- Data-Driven Testing - Assessment•15 minutes
In this module, we will explore Behavior-Driven Development (BDD) and its application with Playwright. Learn to write human-readable tests and enhance collaboration between teams using the Behave framework.
What's included
5 videos3 assignments
5 videos•Total 21 minutes
- What Is Behavior-Driven Development?•2 minutes
- Project Setup•2 minutes
- Define Feature•5 minutes
- Implement Steps•10 minutes
- Running Tests•2 minutes
3 assignments•Total 90 minutes
- Behavior-Driven Development - Assessment•15 minutes
- Full Course Assessment•60 minutes
- Full Course Practice Assessment•15 minutes
Instructor
Explore more from Mobile and Web Development
- Status: Preview
Course
- Status: Free Trial
Course
- Status: Free Trial
Specialization
Why people choose Coursera for their career
Frequently asked questions
Yes, you can preview the first video and view the syllabus before you enroll. You must purchase the course to access content not included in the preview.
If you decide to enroll in the course before the session start date, you will have access to all of the lecture videos and readings for the course. You’ll be able to submit assignments once the session starts.
Once you enroll and your session begins, you will have access to all videos and other resources, including reading items and the course discussion forum. You’ll be able to view and submit practice assessments, and complete required graded assignments to earn a grade and a Course Certificate.
More questions
Financial aid available,
