
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Explore Playwright with Python to automate web and API testing from scratch. Learn about automatic waiting, built-in locks and screenshots, and end-to-end automation across browsers and OS.
Designs a Playwright Python automation testing curriculum from scratch, covering Python basics, Pi test fundamentals, UI and API automation, and building a robust framework with CI/CD.
Install and set up python on windows from python.org, run the installer, enable add to path, and verify with where python and python --version (shows 3.1.6).
Learn to install Python 3 on Mac, handle the default Python 2 vs Python 3, and locate installed versions under Library/Frameworks/Python.framework/Versions and /usr/local/bin using which python3.
Install PyCharm, create the Pi test Python project, and configure a custom interpreter to use your system Python. Verify the interpreter path in settings to sync environments.
Install pi test and playwright using pip, then add the pi test playwright plugin to run playwright tests on the pi test framework in PyCharm across Windows and Mac.
Master Python basics for Playwright automation with hands-on PyCharm setup, including print statements, variables, strings, comments with hash, and the role of indentation in Python code.
Explore Python data types and identify them at run time using the type command, including integers, floats, and strings, and learn safe string and variable concatenation with the format method.
Explore Python numeric data types—integers, floats, complex numbers—and string, list, tuple, and dictionary types, and learn list operations such as indexing, slicing, insert, append, update, and delete.
Understand Python data types by comparing tuples and lists—tuples are immutable while lists are mutable, using round versus square brackets—and see dictionaries as key-value pairs with curly braces.
Explore python's if-else condition syntax, emphasizing colon-based blocks, indentation instead of braces, and proper else handling with practical examples like greeting comparisons and a > 2 checks.
learn to create an empty dictionary at runtime and dynamically add key-value pairs such as first name, last name, and city, then read values.
Demonstrate how to use a Python for loop to iterate over a list, print values, and compute multiples of two and the sum of the first five natural numbers.
Master Python for loops by using range with start, end, and step, including default behavior and skipping indices, and iterating over lists as shown, with while loop coming next.
Master Python while loops by controlling iteration with conditions, avoiding infinite loops, and using break, continue, and if statements to manage output.
Learn to declare and call Python functions with def, a function name, and a colon, using indentation; pass parameters, print, and return values with greet me and add integers.
Define classes as blueprints in Python, illustrate a calculator with methods like sum, addition, and multiplication, and create objects via dot notation.
Explore how constructors in Python initialize objects automatically, differentiate default and parameterized constructors, and use self to manage instance variables versus class variables.
Understand Python inheritance: a child class gains the parent’s properties and methods, imports the parent, and calls the parent constructor to initialize values in automation frameworks.
Learn how to work with Python strings, including indexing, substring extraction, concatenation, in-operator checks, and split and trim using strip, left strip, and right strip.
Learn how to read and write text files with Python, using open, read, readline, and loops to print lines, while safely closing files to avoid memory leaks.
Learn to print a file line by line with the read line method and a while loop, or use read lines to load all lines into a list for iteration.
Learn to write data to text files in Python using with open, read lines, reverse the content, and write it back, with examples of read and write modes.
Explore pytest fixtures and their role in test setup, sharing reusable pre-work across tests. Learn function and module scopes, linking fixtures to tests for automated Playwright tests.
Discover how pytest fixtures manage scope—from function to session—use conftest for shared setup, and run tests with pytest to observe fixture behavior across files.
Learn how to use pytest fixtures to return values and manage setup and teardown with the yield keyword, including function and session scope and data injection into tests.
Learn to run pytest from the command line by file or function, enable logs with -s, skip tests with pytest.mark.skip, and run by tag with -m, preparing for CI/CD workflows.
Launch the chromium engine with the pytest playwright fixture, and run in headless mode by default. Open a new browser context, create a page, and go to Rahul Shetty Academy.com.
Learn to use the Playwright page fixture in pytest to auto-create browser, context, and page objects and navigate with page.go_to, with options for headless or headed modes and cross-browser usage.
Explore core locators in Playwright, using get by label and get by role to identify inputs, selects, and form elements, then fill credentials and choose options.
Understand limitations of get by label: inputs must be inside a label or linked by for and id. Use get by role and CSS selectors for buttons, links, and checkboxes.
Explore Playwright's autowait for automatic checks of visibility, stability, and events, including auto retrying assertions, to detect the sign-in error message without explicit waits.
Learn to run Playwright tests in Firefox by replacing Chromium, launching Firefox (headless or visible), and opening a new page to reuse the same test code.
Learn to create a dynamic Playwright script that logs in, scans product cards, identifies iPhone X and Nokia Edge by name, and adds them to the cart with count verification.
Learn to handle child windows in Playwright Python by creating a new page object for the child window and using expect popup inside a closure to interact with it.
Extract the email id from text by splitting on the at keyword and space, stripping spaces, then assert the actual value equals the expected value in a playwright python test.
Explore using the get by placeholder locator in Playwright Python to validate visibility and hidden states, including interacting with a hide button and asserting outcomes.
Learn to handle javascript alerts and popups in Playwright Python by using on events and dialog.accept, with lambda functions for clean, non-web dialog handling.
Explore how to identify frames with frame locator in Playwright, switch to the frame, access its page content, click the all access plan link, and verify happy subscribers text.
Identify the dynamic price column and rice row in a web table, extract the price, and validate that rice costs 37 using a Python Selenium approach.
Learn end-to-end web table handling in playwright by locating the price column with nth-of in a row, validating 37 with expect, and mastering hover mega menus.
Record and playback tests with playwright codegen to generate code from your web flow using a base url. Refine locators, replace unreliable selectors, and tailor code to your framework standards.
Obtain a token by posting a login payload with Playwright's APIRequestContext, asserting a 200 status with response.ok, extract token from JSON body, and reuse it in create_order by calling get_token.
Refactor api utils to create an order via a single Playwright instance, extract the order id from the response, and verify it appears in the order history page.
Dynamically locate the order id from the history table using Playwright Python, filter the row by text, and click the view button to verify details in an end-to-end test.
Intercept and mock API responses with Playwright to validate UI behavior without changing test data. Learn to simulate no orders by overriding JSON responses and revert to real calls.
Learn to intercept network calls with route.fulfill in Playwright to mock API responses and test edge cases such as zero orders.
Intercept request calls with Playwright route.continue to test edge cases by mocking the get order details API and confirming the unauthorized order message.
Learn to bypass login in Playwright Python tests by injecting the authentication token into browser local storage, enabling direct access to the orders page for faster automated testing.
Adopt best practices to convert code into a maintainable Playwright framework, avoid hard coded data, and load test data from external JSON files using a page object model.
Drive test data from external json files into Playwright fixtures, enabling data-driven web and API tests with credentials in json payloads and parameterization for multiple data sets.
Parameterize pytest tests with multiple data sets stored as a list of dictionaries, using fixtures and request.param to drive two test iterations with user credentials.
Apply the page object design pattern to organize tests with login and dashboard pages, centralizing actions and locators. Drive data from tests and remove hard coded values for maintainable automation.
Apply a page object design to end-to-end tests in Python, driving login and dashboard flows with reusable page methods, and data-driven credentials via pytest fixtures for a clean test structure.
Optimize tests by avoiding object creation and returning page objects between pages. Implement per-page classes and pass the shared page to enable fluent navigation.
Welcome to the comprehensive Playwright Python course that covers everything from the basics to frameworks, including Python & Pytest fundamentals without need of any prior Python experience.
Combining Playwright with Python unlocks powerful capabilities that can drive innovation in test automation frameworks. Let me walk you through why this combination stands out:
Why Python? Python is not only one of the most versatile programming languages, but it’s also the backbone of Machine Learning (AI) development. Its extensive frameworks for AI integration make it a natural choice for building automation frameworks that leverage AI-driven capabilities.
Why Playwright? Playwright has been growing exponentially boasting a 750% increase in usage every year. Known for its speed, reliability, and ability to automate both UI and API applications, it’s quickly becoming a top competitor to Selenium in the test automation space.
Bringing Playwright and Python together enables you to craft a robust, future-ready test automation framework with AI capabilities of handling even the most complex web and API-based applications.
In this course, you’ll systematically learn:
Python essentials
Playwright automation with Python
Pytest frameworks
Behavior-driven development (Pytest BDD)
Whether you’re just starting out or looking to expand your skillset, this course is designed with no prerequisites—everything is covered step by step to ensure a seamless learning experience.
Imagine the boost this combination can bring to your resume in the evolving test automation era!
I can’t wait to see you in the course and help you unlock new opportunities in your career.
Note : For Beginners, there is 3 hours Python video in the beginning of this course which covers all Python basics from Scratch including coding Assignments and quizzes which prepares candidates for Interviews.
Course Structure Breakdown:
Python/Pytest Basics for Beginners (3 hrs) - Build a solid Python foundation for confident Playwright exploration.
Playwright Web/UI Automation (50%) - Master core Playwright concepts for comprehensive UI automation.
Mixed Web & API Testing with Network Mocking (25%) - Expand your skills by combining UI and API testing with network mocking capabilities.
Playwright Advanced Framework Features (25%) - Dive deep into advanced Playwright frameworks for optimal test design.
In conclusion, this course is a one-stop shop for you to become a Playwright hero and take charge of modern, full end-to-end test automation.
Become a Playwright hero and embrace the future of end-to-end test automation. Enroll today!