# microsoft/playwright-python

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/microsoft-playwright-python).**

14,279 stars · 1,127 forks · Python · apache-2.0

## Links

- GitHub: https://github.com/microsoft/playwright-python
- Homepage: https://playwright.dev/python/
- awesome-repositories: https://awesome-repositories.com/repository/microsoft-playwright-python.md

## Topics

`chromium` `firefox` `playwright` `webkit`

## Description

Playwright for Python is a browser automation framework designed for end-to-end testing, web scraping, and user interaction simulation. It functions as a headless browser controller that enables programmatic navigation, data extraction, and the execution of complex workflows across multiple rendering engines.

The framework distinguishes itself through an actionability-aware interaction engine that automatically verifies element readiness before performing actions, significantly reducing test flakiness. It utilizes isolated browser contexts to maintain separate storage and cookies for parallel execution, while its network interception capabilities allow for real-time traffic modification, mocking, and API-level validation.

The platform provides a comprehensive suite of tools for managing browser lifecycles, including device emulation, geolocation overrides, and the ability to manipulate browser time. It supports advanced debugging through execution traces, visual session recording, and breakpoint inspection, ensuring visibility into automated processes.

The project is distributed as a Python library and includes built-in support for containerized environments and remote browser connections.

## Tags

### Testing & Quality Assurance

- [End-to-End Testing](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/e2e-integration-testing/end-to-end-testing.md) — Verifies complete user workflows by orchestrating browser actions, network traffic interception, and state validation. ([source](https://playwright.dev/python/docs/api-testing))
- [Browser Automation Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/browser-and-ui-testing/browser-automation-frameworks.md) — Provides programmatic control over web browsers to automate user interactions, testing, and data extraction. ([source](https://playwright.dev/python/docs/running-tests))
- [Browser Automation](https://awesome-repositories.com/f/testing-quality-assurance/automation-interaction-tools/browser-automation.md) — Controls web browsers programmatically to perform repetitive tasks, extract data, or simulate complex user behavior.
- [Headless Browser Controllers](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/browser-and-ui-testing/browser-automation-frameworks/headless-browser-controllers.md) — Manages headless or headed browser instances to execute automated tasks, visual regression testing, and performance monitoring.
- [API and Network Testing](https://awesome-repositories.com/f/testing-quality-assurance/api-network-testing.md) — Validates backend services and simulates network conditions by intercepting, mocking, or modifying HTTP and WebSocket traffic.
- [Element Interaction](https://awesome-repositories.com/f/testing-quality-assurance/automation-interaction-tools/element-interaction.md) — Provides high-level APIs for simulating user input on web elements with automatic readiness checks. ([source](https://playwright.dev/python/docs/writing-tests))
- [Browser Context Isolation](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-isolation/browser-context-isolation.md) — Creates ephemeral, independent browser sessions that maintain separate storage and cookies for parallel execution.
- [Network and API Mocking](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/network-api-mocking.md) — Intercepts network traffic to return custom payloads, ensuring tests remain fast and independent of live backend services. ([source](https://playwright.dev/python/docs/network))
- [Actionability Verification](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/browser-and-ui-testing/actionability-verification.md) — Automatically verifies element visibility, stability, and readiness before performing actions to prevent flaky test failures.
- [Cross-Browser Testing Tools](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/execution-and-infrastructure/test-infrastructure-configuration/cross-browser-testing-tools.md) — Ensures web applications render and behave consistently by running automated test suites across multiple browser engines.
- [Page Object Models](https://awesome-repositories.com/f/testing-quality-assurance/testing-best-practices-methodologies/test-architecture-patterns/page-object-models.md) — Encapsulates page elements and actions into reusable objects to improve test maintainability. ([source](https://playwright.dev/python/docs/pom))
- [Browser Environment Emulators](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/browser-environment-emulators.md) — Simulates diverse device profiles, viewports, and network conditions for cross-environment testing. ([source](https://playwright.dev/python/docs/codegen))
- [Auto-Waiting Assertions](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/assertion-extensions-modes/asynchronous-interaction-utilities/auto-waiting-assertions.md) — Repeatedly polls application state until conditions are met to handle dynamic content updates during testing.
- [API Response Modifiers](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/network-api-mocking/api-response-modifiers.md) — Intercepts and modifies API responses in real-time to simulate backend edge cases during automated testing. ([source](https://playwright.dev/python/docs/mock))
- [Network Traffic Monitors](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/network-api-mocking/network-traffic-monitors.md) — Tracks real-time network activity and WebSocket frame exchanges for debugging and state verification. ([source](https://playwright.dev/python/docs/network))
- [Test Execution Runners](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/execution-and-infrastructure/test-execution-runners.md) — Manages the parallel execution of test suites across multiple processes to optimize runtime. ([source](https://playwright.dev/python/docs/running-tests))
- [Screenshot Capture](https://awesome-repositories.com/f/testing-quality-assurance/automation-interaction-tools/screenshot-capture.md) — Captures visual screenshots of web pages or elements for documentation and visual regression testing. ([source](https://playwright.dev/python/docs/screenshots))
- [Time Manipulation](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/browser-ui-interaction/browser-environment-emulation/time-manipulation.md) — Overrides native browser time functions to enable deterministic testing of time-dependent features. ([source](https://playwright.dev/python/docs/clock))
- [Form Interaction Utilities](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/browser-ui-interaction/component-interaction-testing/form-interaction-utilities.md) — Automates data entry into form fields by focusing elements and triggering standard input events. ([source](https://playwright.dev/python/docs/input))
- [Fixture Injection](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/browser-and-ui-testing/browser-automation-frameworks/fixture-injection.md) — Provides pre-configured browser, context, and page objects as test arguments to manage lifecycles automatically. ([source](https://playwright.dev/python/docs/test-runners))
- [Accessibility Snapshot Testing](https://awesome-repositories.com/f/testing-quality-assurance/accessibility-visual-testing/accessibility-testing/accessibility-snapshot-testing.md) — Captures accessibility trees as YAML snapshots to verify application accessibility standards in automated tests. ([source](https://playwright.dev/python/docs/aria-snapshots))
- [Network Resilience Simulators](https://awesome-repositories.com/f/testing-quality-assurance/network-resilience-simulators.md) — Toggles browser offline status and network conditions to verify application resilience and fallback behavior. ([source](https://playwright.dev/python/docs/emulation))
- [Custom Selector Engines](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/browser-ui-interaction/ui-element-selectors/custom-selector-engines.md) — Registers custom logic for locating elements on a page to support complex or non-standard DOM structures. ([source](https://playwright.dev/python/docs/api/class-playwright))
- [HTTP Request Clients](https://awesome-repositories.com/f/testing-quality-assurance/http-request-clients.md) — Provides programmatic HTTP request execution for validating backend endpoints and performing data operations during test workflows. ([source](https://playwright.dev/python/docs/api-testing))
- [Regional Configuration Utilities](https://awesome-repositories.com/f/testing-quality-assurance/regional-configuration-utilities.md) — Adjusts browser language and timezone settings to verify application behavior across global regions. ([source](https://playwright.dev/python/docs/emulation))

### Development Tools & Productivity

- [Web Scraping](https://awesome-repositories.com/f/development-tools-productivity/web-scraping.md) — Provides programmatic navigation and data extraction capabilities for web scraping and automated testing.
- [Trace Inspection Tools](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/debugging-diagnostics/execution-trace-log-analyzers/trace-inspection-tools.md) — Records full-fidelity execution traces, including network activity and DOM snapshots, for debugging failed test runs. ([source](https://playwright.dev/python/docs/trace-viewer))
- [Test Trace Viewers](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/test-execution-management/test-trace-viewers.md) — Visualizes recorded test sessions by replaying actions and inspecting diagnostic data for every step. ([source](https://playwright.dev/python/docs/debug))
- [Pointer Interaction Primitives](https://awesome-repositories.com/f/development-tools-productivity/action-execution-frameworks/pointer-interaction-primitives.md) — Performs pointer-based actions like clicks and drag-and-drop while ensuring elements are actionable. ([source](https://playwright.dev/python/docs/input))
- [Automation Visualizers](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/debugging-diagnostics/debugging-inspection-tools/debugging-and-inspection-tools/automation-visualizers.md) — Visualizes browser actions in real-time or slows down execution speed to inspect and troubleshoot complex interaction flows. ([source](https://playwright.dev/python/docs/library))
- [Debugging and Inspection Tools](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/debugging-diagnostics/debugging-inspection-tools/debugging-and-inspection-tools.md) — Pauses test execution at specific lines to allow interactive inspection of the browser state and application variables. ([source](https://playwright.dev/python/docs/test-runners))

### User Interface & Experience

- [Semantic Locators](https://awesome-repositories.com/f/user-interface-experience/element-locators/semantic-locators.md) — The framework locates web elements using semantic properties like roles or labels to ensure that automation remains resilient to structural changes and reflects real user interactions. ([source](https://playwright.dev/python/docs/locators))
- [Locator Chaining](https://awesome-repositories.com/f/user-interface-experience/element-locators/locator-chaining.md) — The framework refines element selection by chaining multiple conditions together to target specific elements accurately even when the user interface changes dynamically during test execution. ([source](https://playwright.dev/python/docs/locators))
- [Automation Selectors](https://awesome-repositories.com/f/user-interface-experience/css-selectors/automation-selectors.md) — Finds elements using CSS or XPath expressions when semantic properties are unavailable. ([source](https://playwright.dev/python/docs/locators))
- [Multi-Window Controllers](https://awesome-repositories.com/f/user-interface-experience/window-management/multi-window-controllers.md) — Manages multiple concurrent browser windows, tabs, and popups during automated sessions. ([source](https://playwright.dev/python/docs/pages))
- [Focus Management](https://awesome-repositories.com/f/user-interface-experience/focus-management.md) — Provides programmatic control over element focus to trigger dynamic application behaviors during automated testing. ([source](https://playwright.dev/python/docs/input))
- [Index-Based Selectors](https://awesome-repositories.com/f/user-interface-experience/selection-lists/index-based-selectors.md) — The framework targets individual elements within a collection by their index or position to interact with the first, last, or any specific occurrence within a list. ([source](https://playwright.dev/python/docs/locators))
- [Touch Gesture Recognition Libraries](https://awesome-repositories.com/f/user-interface-experience/touch-gesture-recognition-libraries.md) — Simulates mobile-style touch gestures like swipes, pinches, and taps on web elements. ([source](https://playwright.dev/python/docs/touch-events))

### Web Development

- [Browser Navigation](https://awesome-repositories.com/f/web-development/web-automation-scraping/browser-interaction-primitives/browser-navigation.md) — Directs browsers to specific web addresses and manages page load events for automated interaction. ([source](https://playwright.dev/python/docs/pages))
- [JavaScript Execution Bridges](https://awesome-repositories.com/f/web-development/browser-integration-utilities/browser-infrastructure/javascript-execution-bridges.md) — Executes custom JavaScript within the browser context and serializes results back to the automation environment. ([source](https://playwright.dev/python/docs/evaluating))
- [Browser Session Persistence](https://awesome-repositories.com/f/web-development/browser-session-persistence.md) — Persists and restores cookies, local storage, and tokens across browser contexts to bypass repetitive login steps. ([source](https://playwright.dev/python/docs/auth))
- [Keyboard Input Simulations](https://awesome-repositories.com/f/web-development/web-automation-scraping/browser-interaction-primitives/keyboard-input-simulations.md) — Simulates precise keyboard sequences and shortcuts for testing input handling requirements. ([source](https://playwright.dev/python/docs/input))
- [Browser Binary Managers](https://awesome-repositories.com/f/web-development/web-automation-scraping/browser-orchestration-systems/browser-binary-managers.md) — Manages the download, installation, and removal of browser engine binaries for automated environments. ([source](https://playwright.dev/python/docs/browsers))
- [Browser Session Recorders](https://awesome-repositories.com/f/web-development/web-automation-scraping/web-scraping-automation/browser-automation/browser-session-recorders.md) — Records video of browser interactions during automated test sessions for post-mortem analysis. ([source](https://playwright.dev/python/docs/videos))
- [WebSockets](https://awesome-repositories.com/f/web-development/websockets.md) — Communicates with browser engines via persistent WebSocket connections to execute commands and receive events in real-time.
- [Driver Protocols](https://awesome-repositories.com/f/web-development/browser-automation-protocols/driver-protocols.md) — Uses a unified wire protocol to bridge high-level automation commands to multiple browser-specific implementations.
- [Capture Utilities](https://awesome-repositories.com/f/web-development/browser-integration-utilities/browser-compatibility-utilities/file-download-utilities/capture-utilities.md) — Captures file downloads triggered by web pages, providing access to source URLs and data streams. ([source](https://playwright.dev/python/docs/downloads))
- [Uniqueness Enforcement](https://awesome-repositories.com/f/web-development/element-selectors/uniqueness-enforcement.md) — The framework throws an error when multiple elements match a single selector to prevent ambiguous interactions and ensure that every test step targets exactly one specific element. ([source](https://playwright.dev/python/docs/locators))
- [HTTP Request Interceptors](https://awesome-repositories.com/f/web-development/http-request-interceptors.md) — Handles HTTP authentication challenges by injecting credentials during the request lifecycle. ([source](https://playwright.dev/python/docs/network))
- [Browser Dialog Handlers](https://awesome-repositories.com/f/web-development/web-automation-scraping/browser-dialog-event-handlers/browser-dialog-handlers.md) — Intercepts and programmatically handles native browser alerts, confirmations, and prompts during automated interactions. ([source](https://playwright.dev/python/docs/dialogs))
- [Browser Permission Management](https://awesome-repositories.com/f/web-development/web-automation-scraping/browser-environment-configurations/browser-permission-management.md) — Manages browser-level permissions like geolocation and notifications for specific domains during automated sessions. ([source](https://playwright.dev/python/docs/emulation))
- [Geolocation Emulation Tools](https://awesome-repositories.com/f/web-development/web-automation-scraping/browser-environment-configurations/geolocation-emulation-tools.md) — Overrides browser geolocation coordinates to verify location-aware web features. ([source](https://playwright.dev/python/docs/emulation))
- [File Upload Utilities](https://awesome-repositories.com/f/web-development/web-automation-scraping/browser-interaction-primitives/file-upload-utilities.md) — Automates the selection and uploading of files into web input elements during browser sessions. ([source](https://playwright.dev/python/docs/input))
- [Frame Interactions](https://awesome-repositories.com/f/web-development/web-automation-scraping/browser-interaction-primitives/frame-interactions.md) — Identifies and performs automated actions within nested iframe structures on a web page. ([source](https://playwright.dev/python/docs/frames))
- [Remote Browser Connections](https://awesome-repositories.com/f/web-development/web-automation-scraping/browser-orchestration-systems/remote-browser-connections.md) — Executes browser automation tasks on a remote server or container while keeping the test logic running locally. ([source](https://playwright.dev/python/docs/docker))
- [Browser Extensions](https://awesome-repositories.com/f/web-development/browser-integration-utilities/browser-extension-development/browser-extensions.md) — Integrates local browser extensions into automated sessions by configuring browser contexts to load extension files. ([source](https://playwright.dev/python/docs/chrome-extensions))
- [Browser Scripting Tools](https://awesome-repositories.com/f/web-development/browser-scripting-tools.md) — Runs arbitrary scripts within the browser context to perform complex inspections or manual manipulations. ([source](https://playwright.dev/python/docs/locators))

### Networking & Communication

- [Network Interception Tools](https://awesome-repositories.com/f/networking-communication/network-reliability-diagnostics/network-interception-tools.md) — Hooks into the browser network stack to intercept, block, or modify HTTP and WebSocket traffic for mocking and simulation.
- [Network Request Interceptors](https://awesome-repositories.com/f/networking-communication/network-request-interceptors.md) — Blocks outgoing network requests to isolate frontend components from backend dependencies during test execution. ([source](https://playwright.dev/python/docs/mock))
- [Traffic Routing Proxies](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-infrastructure-configuration/network-infrastructure/traffic-routing-proxies.md) — Configures browser sessions to route network traffic through proxy servers with authentication support. ([source](https://playwright.dev/python/docs/network))
- [Network Traffic Replay Tools](https://awesome-repositories.com/f/networking-communication/network-traffic-replay-tools.md) — Simulates network interactions by replaying recorded request and response archives during automated test runs. ([source](https://playwright.dev/python/docs/mock))
- [WebSocket Message Interception](https://awesome-repositories.com/f/networking-communication/websocket-message-interception.md) — Monitors and manipulates real-time WebSocket messages to test bidirectional communication flows. ([source](https://playwright.dev/python/docs/mock))

### Security & Cryptography

- [Automated Login Frameworks](https://awesome-repositories.com/f/security-cryptography/authentication-services/automated-login-frameworks.md) — Performs login sequences through browser interactions to establish authenticated session states for automated testing. ([source](https://playwright.dev/python/docs/auth))
- [Session Authentication](https://awesome-repositories.com/f/security-cryptography/session-authentication.md) — Extracts and applies authentication state between browser sessions and API contexts to maintain user sessions. ([source](https://playwright.dev/python/docs/api-testing))

### System Administration & Monitoring

- [Traffic Interception and Modification](https://awesome-repositories.com/f/system-administration-monitoring/administrative-operations/linux-system-administration/networking/traffic-interception-modification.md) — Captures and modifies network traffic in real-time to simulate various network conditions during browser automation. ([source](https://playwright.dev/python/docs/network))
- [Headed Execution Modes](https://awesome-repositories.com/f/system-administration-monitoring/execution-observability/headed-execution-modes.md) — Allows launching browsers with a visible interface to facilitate manual observation of automated workflows. ([source](https://playwright.dev/python/docs/debug))

### Part of an Awesome List

- [Language Bindings](https://awesome-repositories.com/f/awesome-lists/devtools/language-bindings.md) — Official Python port of the automation framework.
- [Testing Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/testing-frameworks.md) — Automates browser interactions for end-to-end testing.
- [Testing Tools](https://awesome-repositories.com/f/awesome-lists/devtools/testing-tools.md) — Listed in the “Testing Tools” section of the Awesome Python awesome list.
- [Web Scraping](https://awesome-repositories.com/f/awesome-lists/devtools/web-scraping.md) — Browser automation library for Python.

### Software Engineering & Architecture

- [Parallel Processing Utilities](https://awesome-repositories.com/f/software-engineering-architecture/parallel-processing-utilities.md) — Distributes test suites across multiple worker processes to maximize CPU utilization and reduce total execution time.
- [Asynchronous Execution](https://awesome-repositories.com/f/software-engineering-architecture/architectural-design-patterns/asynchronous-execution.md) — Runs automation tasks using non-blocking code patterns to integrate with event-driven application architectures. ([source](https://playwright.dev/python/docs/library))

### DevOps & Infrastructure

- [Containerized Execution](https://awesome-repositories.com/f/devops-infrastructure/containerized-execution.md) — Runs browser automation scripts within isolated container environments by providing pre-configured images. ([source](https://playwright.dev/python/docs/docker))

### Operating Systems & Systems Programming

- [Desktop Application Automation](https://awesome-repositories.com/f/operating-systems-systems-programming/desktop-environment-frameworks/desktop-environment-components/desktop-applications/desktop-application-automation.md) — Connects to desktop applications using browser control protocols to perform automation within embedded web views. ([source](https://playwright.dev/python/docs/webview2))
