--- id: selenium-page-factory version: "2.8" license: MIT license_treatment: permissive maintenance: active --- # selenium-page-factory — Python library provides page factory approach to implement page object model in selenium License: permissive · Maintenance: active · Downloads: 80.2K/mo ## 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 above — 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 pip install selenium-page-factory uv add selenium-page-factory 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_current - Install friction: low - Maintenance: active - Downloads: 80.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags page object model selenium, page factory python selenium, selenium page automation, webdriver element wrapper, selenium test framework, page-based test automation, selenium pom library, selenium-testing, page-object-model, test-automation [View on SkillFed](https://skillfed.io/packages/selenium-page-factory) · [View on PyPI](https://pypi.org/project/selenium-page-factory/)