Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Playwright Python and Pytest for Web Automation Testing
Rating: 4.6 out of 5(687 ratings)
5,232 students

Playwright Python and Pytest for Web Automation Testing

Unleash the Power of Playwright and pytest for Web Automation Testing and API Testing
Created byRahul Mula
Last updated 11/2024
English

What you'll learn

  • Write python scripts to launch browsers and automate tasks performed usually on websites
  • Locate web elements using various methods like element role, inner text, form label or placeholder, CSS selectors, and XPath
  • Perform actions on web elements like hover, click, fill form, select option, upload files, and use keyboard shortcuts
  • Handle events like auto-waiting, custom waiting for an element to load, page navigations, requests, and downloads
  • Log in to websites and authenticate yourself using your account like Google accounts
  • Write a script to automate inbox mail checking for new emails and report the same
  • Use pytest to write and run test cases and define custom pytest fixtures to share test state/data
  • Utilize playwright tools like taking screenshots, recording videos, trace viewer, and auto code generator
  • Apply best practices like web-first assertions, Page Object Models (POM), request interceptions and Parallelism
  • Test API endpoints, define custom API request context, handle API responses, and mock API custom data
  • Deploy automated tests using Github CI
  • Practice Behaviour Driven Development (BDD) with playwright and python behave

Course content

21 sections126 lectures10h 6m total length
  • Installation4:57

    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.

  • Playwright Website1:44

    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 Browser6:58

    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.

  • Click Link4:25

    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.

  • Overview2:05

    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.

Requirements

  • Python
  • HTML

Description

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.

Who this course is for:

  • Beginner python developers who wish to learn web automation testing
  • Automation testers who wish to learn about Playwright