VOOZH about

URL: https://www.coursera.org/learn/packt-playwright-python-and-pytest-for-web-automation-testing-la7nu

⇱ Playwright Python and Pytest for Web Automation Testing | Coursera


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

Gain insight into a topic and learn the fundamentals.
4.3

21 reviews

Intermediate level

Recommended experience

2 weeks to complete
at 10 hours a week
Flexible schedule
Learn at your own pace

Gain insight into a topic and learn the fundamentals.
4.3

21 reviews

Intermediate level

Recommended experience

2 weeks to complete
at 10 hours a week
Flexible schedule
Learn at your own pace

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.

Details to know

Shareable certificate

Add to your LinkedIn profile

Assessments

23 assignments

Taught in English

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 videosTotal 20 minutes
  • Playwright Installation5 minutes
  • Playwright Docs2 minutes
  • Launching Browser7 minutes
  • Clicking Link Element4 minutes
  • Script Overview2 minutes
1 readingTotal 10 minutes
  • Full Course Resources10 minutes
1 assignmentTotal 15 minutes
  • Getting Started - Assessment15 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 videosTotal 81 minutes
  • Playwright Python REPL9 minutes
  • Locator Role8 minutes
  • Locators Input Field4 minutes
  • Locator Text4 minutes
  • Locator Alt Text2 minutes
  • Locator Title2 minutes
  • Locating with CSS Selectors10 minutes
  • CSS Selectors Hierarchy8 minutes
  • CSS Selectors Pseudo Classes9 minutes
  • Locators XPath6 minutes
  • XPath Functions7 minutes
  • Other Locators11 minutes
1 assignmentTotal 15 minutes
  • Locators - Assessment15 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 videosTotal 34 minutes
  • Mouse Actions7 minutes
  • Actions Text Input6 minutes
  • Radios, Checkboxes, and Switches6 minutes
  • Select Option3 minutes
  • Dropdown Menu4 minutes
  • Upload Files5 minutes
  • Keyboard Shortcuts4 minutes
1 assignmentTotal 15 minutes
  • Actions - Assessment15 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 videosTotal 52 minutes
  • Playwright Auto-Waiting8 minutes
  • Auto-Waiting Navigation9 minutes
  • Custom Waiting6 minutes
  • Event Listeners8 minutes
  • Handling Dialogs6 minutes
  • Download Files5 minutes
  • What Is Sync and Async?3 minutes
  • Asynchronous Playwright7 minutes
1 assignmentTotal 15 minutes
  • Events - Assessment15 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 videosTotal 20 minutes
  • Google Sign In9 minutes
  • Save Authentication State8 minutes
  • Reuse Auth State2 minutes
  • Google Login Issue1 minute
1 assignmentTotal 15 minutes
  • Authentication - Assessment15 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 videosTotal 33 minutes
  • Automatic Mail Checker1 minute
  • Project Setup2 minutes
  • Locate New Emails9 minutes
  • Locate Email Data4 minutes
  • Combine Locators7 minutes
  • Check Email from Terminal10 minutes
1 assignmentTotal 15 minutes
  • Automated Mail Checker - Assessment15 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 videosTotal 30 minutes
  • Testing Pytest2 minutes
  • Writing Test4 minutes
  • Running Test5 minutes
  • Type Hinting5 minutes
  • Test State4 minutes
  • Pytest Fixture2 minutes
  • Using Fixture5 minutes
  • Fixture Scope4 minutes
1 assignmentTotal 15 minutes
  • Pytest - Assessment15 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 videosTotal 22 minutes
  • Install pytest-playwright Plugin3 minutes
  • Playwright Test5 minutes
  • Running Test3 minutes
  • Pytest Config3 minutes
  • Test Hook8 minutes
1 assignmentTotal 15 minutes
  • pytest-playwright Plugin - Assessment15 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 videosTotal 21 minutes
  • Take Screenshot4 minutes
  • Record Video5 minutes
  • Trace Generator and Viewer8 minutes
  • Playwright Codegen4 minutes
1 assignmentTotal 15 minutes
  • Playwright Tools - Assessment15 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 videosTotal 26 minutes
  • Assertions Page3 minutes
  • Assertions Element State4 minutes
  • Assertions Element Text4 minutes
  • Assertions Attribute5 minutes
  • Assertions Input Field5 minutes
  • Assertions Checkbox2 minutes
  • Assertions Option Menu3 minutes
1 assignmentTotal 15 minutes
  • Web-First Assertions - Assessment15 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 videosTotal 66 minutes
  • UI Testing Dynamic ID3 minutes
  • UI Testing Class Attribute3 minutes
  • UI Testing Hidden Layer5 minutes
  • UI testing Load Delay3 minutes
  • UI Testing Ajax Request2 minutes
  • UI Testing Click Action2 minutes
  • UI Testing Input Field3 minutes
  • UI Testing Scrollbars3 minutes
  • UI Testing Dynamic Table10 minutes
  • UI Testing Verify Text2 minutes
  • UI Testing Progress Bar5 minutes
  • UI Testing Visibility7 minutes
  • UI Testing App Login6 minutes
  • UI Testing Mouse Hover4 minutes
  • UI Testing NBSP Character2 minutes
  • UI Testing Overlapped5 minutes
1 assignmentTotal 15 minutes
  • UI Testing Playground - Assessment15 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 videosTotal 15 minutes
  • Function Scope Fixtures2 minutes
  • Session Scope Fixtures4 minutes
  • Browser Selection3 minutes
  • Browser Launch and Context Arguments6 minutes
1 assignmentTotal 15 minutes
  • Playwright Fixtures - Assessment15 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 videosTotal 20 minutes
  • What Is Page Object Model?4 minutes
  • Page Object Model Implementation3 minutes
  • Page Object Model Usage2 minutes
  • Playwright Homepage POM6 minutes
  • POM Usage6 minutes
1 assignmentTotal 15 minutes
  • Page Object Model (POM) - Assessment15 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 videosTotal 18 minutes
  • Network Events3 minutes
  • Handle Requests10 minutes
  • Modify Response5 minutes
1 assignmentTotal 15 minutes
  • Network Events - Assessment15 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 videosTotal 31 minutes
  • Making an API Call5 minutes
  • API Request Context4 minutes
  • API Query String7 minutes
  • CRUD Operations11 minutes
  • Mock API5 minutes
1 assignmentTotal 15 minutes
  • API Testing - Assessment15 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 videosTotal 15 minutes
  • Intercept Requests7 minutes
  • Disabling JavaScript4 minutes
  • Run Tests in Parallel4 minutes
1 assignmentTotal 15 minutes
  • Optimization - Assessment15 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 videosTotal 20 minutes
  • Pytest CLI Arguments6 minutes
  • Python Debugger4 minutes
  • Device Emulation4 minutes
  • Evaluate JavaScript4 minutes
  • Generate Reports3 minutes
1 assignmentTotal 15 minutes
  • Tips and Tricks - Assessment15 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 videosTotal 30 minutes
  • GitHub API Introduction1 minute
  • Project Setup6 minutes
  • GitHub Token4 minutes
  • Authorized API Context7 minutes
  • Writing Tests11 minutes
  • Running Tests2 minutes
1 assignmentTotal 15 minutes
  • GitHub API - Assessment15 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 videosTotal 26 minutes
  • GitHub CI Introduction1 minute
  • Setup Repository4 minutes
  • Writing Tests7 minutes
  • GitHub Action10 minutes
  • Running Automated Tests5 minutes
1 assignmentTotal 15 minutes
  • Continuous Integration (CI) - Assessment15 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 videosTotal 7 minutes
  • What Is Data-Driven Testing?1 minute
  • Pytest Parametrize4 minutes
  • Running Test2 minutes
1 assignmentTotal 15 minutes
  • Data-Driven Testing - Assessment15 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 videosTotal 21 minutes
  • What Is Behavior-Driven Development?2 minutes
  • Project Setup2 minutes
  • Define Feature5 minutes
  • Implement Steps10 minutes
  • Running Tests2 minutes
3 assignmentsTotal 90 minutes
  • Behavior-Driven Development - Assessment15 minutes
  • Full Course Assessment60 minutes
  • Full Course Practice Assessment15 minutes

Instructor

Instructor ratings
4.2 (6 ratings)

Offered by

Explore more from Mobile and Web Development

Why people choose Coursera for their career

👁 Image

Felipe M.

Learner since 2018
"To be able to take courses at my own pace and rhythm has been an amazing experience. I can learn whenever it fits my schedule and mood."
👁 Image

Jennifer J.

Learner since 2020
"I directly applied the concepts and skills I learned from my courses to an exciting new project at work."
👁 Image

Larry W.

Learner since 2021
"When I need courses on topics that my university doesn't offer, Coursera is one of the best places to go."
👁 Image

Chaitanya A.

"Learning isn't just about being better at your job: it's so much more than that. Coursera allows me to learn without limits."

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.

If you complete the course successfully, your electronic Course Certificate will be added to your Accomplishments page - from there, you can print your Course Certificate or add it to your LinkedIn profile.

This course is currently available only to learners who have paid or received financial aid, when available.

Yes. In select learning programs, you can apply for financial aid or a scholarship if you can’t afford the enrollment fee. If fin aid or scholarship is available for your learning program selection, you’ll find a link to apply on the description page.

Financial aid available,