selenium-page-factory
Python library provides page factory approach to implement page object model in selenium
What it is and what it does
selenium-page-factory provides a Python implementation of the page factory pattern, a structured way to organize Selenium test automation code. Instead of scattering WebDriver element locators throughout test code, you declare all page elements in a dictionary within a PageFactory subclass; the library then initializes them as class members with extended methods. Each extended method wraps standard Selenium operations with explicit waits, retry logic, and visual debugging (element highlighting). The package supports Selenium 4 ActionChains, Appium for mobile testing, and specialized operations like drag-and-drop, scroll-into-view, and click-with-retry to handle flaky tests.
It's designed for teams building maintainable Selenium test suites where page structure is centralized and reusable. You define a page class once, pass in a WebDriver instance, set optional timeouts and highlighting, and then call extended methods like set_text, click_button, or select_element_by_text on declared elements. The library handles visibility and clickability checks before acting, reducing boilerplate waits in test code.
Use it for:
- Organize large Selenium test suites by centralizing page element locators and interactions in reusable page classes.
- Reduce flaky test failures by using built-in explicit waits and click-with-retry on elements before interaction.
- Automate web application testing with Appium support for both desktop and mobile test scenarios.
- Debug test failures faster by enabling element highlighting to see which elements are being interacted with.
- Manage complex multi-element interactions (lists, tables, dropdowns) with extended methods like get_list_item_count and select_element_by_text.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements a page factory pattern for Selenium test automation, wrapping WebDriver elements with extended methods that include built-in waits, retry logic, and action chains support.
Yes. The package is actively maintained, has no known vulnerabilities, supports current Python versions, and solves a real problem in Selenium test organization. Install friction is low with one dependency. MIT licensing carries no restrictions. Suitable for teams building or scaling Selenium test automation who want a structured page object pattern without heavy framework overhead.
Install
selenium-page-factory on PyPI
pip
pip install selenium-page-factoryuv
uv add selenium-page-factorypoetry
poetry add selenium-page-factoryInstalling selenium-page-factory
Before you install
Low friction install with a single runtime dependency (selenium). Actively maintained with a recent release 73 days ago and ongoing commits; supports modern Python versions 3.7–3.12.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects without legal friction.
Quickstart
pip install selenium-page-factory
from selenium_page_factory import PageFactory
class MyPage(PageFactory):
def __init__(self, driver):
self.driver = driver
self.timeout = 15
page = MyPage(driver)
page.set_text(locator, 'text')
page.click_button(locator)
Requires a WebDriver instance (from selenium) and a target web application to interact with.
Verify before relying
- Whether the unittest coverage claim in the description is accurate and what it measures.
- Performance characteristics when managing large numbers of page elements or complex wait conditions.
- How retry and flaky-test handling mechanisms interact with Selenium 4 ActionChains in practice.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — selenium |
| Maintenance | actively maintained — 73 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 80,249/month — #14,303 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: selenium_page_factory-2.8-py3-none-any.whl
Keywords: selenium, page object model, pom, pages, page factory, automation, testing, webdriver
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
Selenium-ScreenshotCaptures full-page or element-level screenshots…
permissive · top 15,000 on PyPI
robotframework-extendedselenium2libraryA Robot Framework library for web browser…
agpl · top 15,000 on PyPI
Appium-Python-ClientExtends Selenium Python bindings with…
permissive · top 5,000 on PyPI
seleniumSelenium provides Python bindings to automate…
permissive · top 1,000 on PyPI
webdriver-managerAutomatically downloads, caches, and manages…
permissive · top 5,000 on PyPI
seletoolsProvides helper functions for Selenium…
permissive · top 15,000 on PyPI
requestiumRequestium merges Requests, Selenium, and…
permissive · top 15,000 on PyPI
selenium-wireExtends Selenium's Python bindings to…
permissive · top 5,000 on PyPI
robotframework-selenium2libraryA Robot Framework library that wraps Selenium…
permissive · top 15,000 on PyPI
eyes-seleniumVisual testing SDK for Selenium and Appium…
unclear · top 15,000 on PyPI