
Install Playwright in a virtual environment with the latest Python version, activate it, upgrade pip, verify the version, and install browser drivers (chromium and webkit) for web automation testing.
Learn to start web automation with Playwright in Python by launching Chrome, opening a page, and navigating playwright.dev docs to access the Python guide.
Launch a browser with Playwright's Python sync API to visit the Playwright home page, click the docs button, and navigate to the documentation site.
Launch the browser, navigate to the playwright website, and click the docs link using get by role to demonstrate locating a link by its name.
Launch a browser with Playwright Python, locate a link by role and name, click it, and print the docs URL while learning about various locators.
Explore Playwright in Python REPL to launch a browser, navigate pages, and test locators like get by role interactively, including clicking the get started button.
master the get_by_role locator in Playwright Python to find buttons, headings, radio and checkbox by role and name, inspect elements with the browser inspector, and test interactions.
Learn to locate input fields in web automation tests using get by label and get by placeholder methods, highlighting and interacting with email, password, and text area fields.
Learn to locate elements by text with get by text locator to highlight and interact with elements like muted text, small buttons, and middle button, using contains or exact matching.
Use the get by alt text locator to locate images by their alt attributes on Unsplash, then highlight or click to navigate to the image details page.
Learn to locate web elements with the get by title locator using an element's title attribute, and highlight elements such as abbreviations and sources that have a unique title.
Learn to use css selectors with Playwright to locate web elements by tag name, class, id, and attribute value, and test them in dev tools.
Learn to select web elements by hierarchy using CSS selectors, combining parent and child relationships, with examples for nav bars, active links, and multiple classes.
Explore how Playwright CSS selectors use pseudo classes to locate elements by text, visible, and position, with examples for headings and buttons.
Explore XPath, the XML querying language, to locate web elements with absolute and relative paths, select by tag and attributes, and use Playwright page locator with XPath.
Learn to locate web elements with XPath functions in Playwright, using text(), contains(), and attribute-based selectors on h1, buttons, and inputs, including class and value attributes.
Explore miscellaneous locators in Playwright, including end selectors, parent dot dot, id-based and visibility filters, and combining with get by role or get by label to target elements.
Learn to perform mouse actions on web elements with Playwright Python and Pytest, including clicking, double-clicking, right-clicking, modifiers, hovering, and using locators to target elements.
Learn how to interact with input fields using Playwright Python: locate fields by label or placeholder, fill, clear, type with delays, and retrieve values using the input value method.
Learn to locate radios, checkboxes, and switches with the get by label locator, then apply check, uncheck, and set checked state to control their status.
Master selecting single and multiple options in a select input using Playwright Python, with get by label locator and the select option method, including timeout handling.
Reveal a dropdown menu by clicking its button, then select the visible menu items with css selectors and the visible pseudo-class, finally click the last dropdown link.
Upload files in Playwright by interacting with a file input field and using set input files for paths, then handle file chooser events triggered by buttons with expect file chooser.
Learn to simulate keyboard key presses inside a text area using the fill command and the press method, including shortcuts like shift plus d and control arrow left.
Learn how Playwright's auto waiting ensures elements are attached, visible, enabled, stable, and clickable before actions, with examples of clicking a button and a dropdown item.
Explore Playwright navigation events and how to use wait until for commit, dom content loaded, load, and network idle, comparing page load timings.
Master custom waiting in Playwright with Python and Pytest to wait for elements after navigation using locators and get by role or text.
Register event listeners with page.on for load, dom content loaded, request, response, and file chooser; print events, inspect pages, and use once or remove listeners for clean automation.
Learn to handle alert, confirm, and prompt dialogs in Playwright with page.on('dialog'), accepting or dismissing, and supplying input for prompts.
Learn to handle downloads in Playwright Python by triggering a download, listening for the event, and saving the file to a chosen path with the save as method.
Explore the difference between synchronous and asynchronous execution in Python, from line-by-line interpretation to threading and multiprocessing, and apply it to Playwright's API for web automation testing.
Explore using playwright's async API to build web automation tests with asyncio, including launching a browser, creating pages, navigating to a URL, awaiting load event, and retrieving the title.
Learn to log in to websites and authenticate with Playwright using Firefox, locate the email and password fields on Google sign-in, and save the login state for reuse.
learn to save and reuse authentication state in playwright by storing storage state in a browser context, enabling login persistence across script runs.
Reuse your saved authentication state stored in a Json file by loading it into a new browser context with the storage state argument, enabling Google account login.
Learn how to bypass Google login issues in playwright by launching Chromium with specific flags, including disabling dev shm usage and disabling automation features.
Automate email checks with playwright by logging into Gmail via authentication state, locating unread messages in the inbox, and reporting them without opening a browser as a hands-on automation project.
Set up a Playwright project by initializing a Python file, importing the synchronous API, launching a headed Firefox browser, and loading the stored authentication state to proceed with Gmail.
Locate new emails in Gmail by locating table rows within a UI table, using anchors and data-tooltip markers to distinguish unread (new) from read (old) emails.
Locate the sender name and short title inside an email by using data attributes, the visible selector, and inner text extraction with Playwright.
Combine locators to extract new emails from a web inbox by selecting rows inside a divider, iterating with all(), and using the mark as read indicator.
Package the script into a single executable with PyInstaller, configure Playwright and the Firefox driver, set the browser path, and run the email check from anywhere.
Discover testing web apps with Playwright and pytest, install pytest in a virtual environment, verify installation with pytest --version, and learn to write a basic test using the pytest plugin.
Write a pytest test for the utils.root function that returns 5 for 25, following test file naming conventions (prefix test_ or suffix _test) and a test_root function, then run pytest.
Run pytest on utils_test.py to execute the root function test, view green dots and logs, and use -v for verbose output and -s to reveal print statements and failures.
Learn the basics of optional type hinting in python, including annotating variables with a colon, typing lists and dicts, and specifying function parameters and return types to improve test clarity.
Demonstrate testing a report module that generates a json file, then reads it into a dict to verify the timestamp and status fields.
Create a pytest fixture to share report data among test functions by returning a loaded json dictionary from a file, using the fixture decorator.
Request the report Json fixture inside test functions to share data between tests and validate fixtures via pytest.
Discover how to use pytest fixture scope to run a report json fixture once per test session, load data once, and share it across multiple tests.
Install the pytest-playwright plugin with pip, then use fixtures and the page object to test a website in pytest, leveraging the playwright sync API and plugin-managed browser lifecycle.
Write your first Playwright test for web automation with pytest and the Playwright plugin. Visit the Playwright home page, click the get started link, and verify the docs URL.
Run Playwright Python tests with pytest by specifying the test file or letting it auto-discover. Toggle headless or headed mode and switch browsers, such as Chromium or Firefox.
Set up a pytest config file to run tests with default options: headed browser, slomo 500, and Firefox, applied automatically via pytest.ini addopts.
Create test hooks with pytest fixtures by building a playwright page fixture that visits the playwright website, verifies docs and get started links, and uses yield for setup and teardown.
Learn to capture screenshots with playwright using the page object's screenshot method, saving the whole page or a single element in png or jpeg formats to a specified path.
Record your Playwright Python tests with pytest as videos by configuring a browser context with a record video directory, and manage it with a fixture that captures the test flow.
Learn to start and stop tracing in pytest with playwright, save the session as trace.zip, and view it in the playwright trace viewer for frame-by-frame actions and screenshots.
Explore Playwright's codegen tool to rapidly generate code for browser actions you perform manually, inspect elements with the inspector, and switch from NodeJS to Python for pytest tests.
Explore using Playwright's web first assertions with the expect API to verify page URL and title in a Python and pytest web automation workflow.
Learn to assert element states in Playwright Python by verifying visible, hidden, and enabled elements, handling timeouts and assertion errors to validate locator behavior.
Learn to assert an element's inner text or contain text using CSS selectors, headers, and a drop down menu, with exact, partial, or regular expression-based text checks.
Master asserting element attributes with Playwright Python and Pytest, verifying classes, IDs, and attributes via role selectors and regex patterns for reliable web automation tests.
Learn to assert input field states in web automation using Playwright and Pytest: reveal a hidden search input via a button or ctrl-k, then verify visibility, emptiness, typing, and value.
Learn to assert that checkboxes are checked or unchecked using label locators and expect statements on the Bootswatch page, validating the default and unchecked states.
Learn to assert values in option and multi select menus using a label locator, validate defaults, select options, and verify results with a Boots.com example.
Playwright is a modern, fast and reliable browser automation tool from Microsoft that enables testing and automation across all modern browsers including chromium, firefox and webkit. Pytest is a popular Python testing framework that offers a simple and flexible way to write and run tests. In this course, you will learn how to blend Playwright capabilities into the Pytest framework with the use of pytest-playwright plugin.
This course is designed for beginners in mind! It's alright if you don't anything about web automation! We will cover all the basics of Playwright and Web Automation Essentials, step by step -
Different method to locate web elements like role, text, css selectors, xpath, etc.
Perform actions on web elements like clicking, filling forms,
Events like Auto-waiting, page navigation, downloads, etc.
Authentication with your google account
As a bonus, we will develop a script to automatically check for new emails in our inbox and report them back i.e. automated mail checking!
After learning web automation, we will start with testing. Again, it's alright if you're new to automation testing or testing at all! You'll go from writing a basic test to deploying automated tests -
Basics of testing with pytest
Playwright pytest plugin
Playwright Tools like trace viewer, codegen, etc.
Web-first assertions using expect( )
Solve modern testing problems with UI Testing Playground
Playwright fixtures, custom setup/teardown using test hooks, , etc.
Implement Page Object Model (POM)
Handle network events
REST API Testing, authentication and API request context
Optimizations techniques like Parallelism
Deploy automated tests to CI
Parameterize tests with predefined test data
Behaviour Driven Development with python behave
and more...
By the end of the course, you will be able to write automated tests and perform fast, reliable, and capable testing and automation using Playwright and Pytest.