skillfed

selenium-page-factory

Python library provides page factory approach to implement page object model in selenium

selenium-page-factory v2.8 80.2K downloads/30d#14,303 on PyPI44
Permissive license MIT Active released

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-factory

uv

uv add selenium-page-factory

poetry

poetry add selenium-page-factory

Installing 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

Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality AssuranceTopic :: Software Development :: Testing

Tags

page object model seleniumpage factory python seleniumselenium page automationwebdriver element wrapperselenium test frameworkpage-based test automationselenium pom library
selenium-testingpage-object-modeltest-automation

More Python Modules packages