Skip to main content

A Selenium Page Factory implementation for Python

Project description

selenium-pagefactory-impl

GitHub license

A Selenium Page Factory implementation for Python, providing enhanced functionality for web automation.

Features

  • Simplified and intelligent page factory for Selenium projects.
  • Convenient methods for interacting with web elements.
  • Improved handling of StaleElementReferenceException.

Installation

Use Poetry to install the package and its dependencies:

poetry install

How to implement in the test

# Import the PageFactory class
from selenium_pagefactory.page_factory_impl import PageFactory

# Your page class using PageFactory
class YourPageClass:
    # Define locators
    locators = {
        'element_name': (By.XPATH, "//your/xpath"),
        # Add more locators as needed
    }

    # Initialize elements using PageFactory
    def __init__(self, driver):
        self.driver = driver
        PageFactory.initialize_elements(self, driver)

# Example usage
driver = webdriver.Chrome()
page_instance = YourPageClass(driver)
page_instance.element_name.click()

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Special thanks to the Selenium and pytest communities.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

selenium_pagefactory_impl-0.1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file selenium_pagefactory_impl-0.1.0.tar.gz.

File metadata

File hashes

Hashes for selenium_pagefactory_impl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 40df4a58c85e363d2f169f056efa0efb06ff607b1fed77c21910fa6f42493b4d
MD5 843b84435c0da67733b5697931f6fc1f
BLAKE2b-256 bf4c4354458ef0db56be23c4b868bbda4f0cdf08bb7eeb2b8d9492cf220ed70d

See more details on using hashes here.

File details

Details for the file selenium_pagefactory_impl-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for selenium_pagefactory_impl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 950e8ec6d5022704862880112e72890541b17ae7baffb3d4e9dcc25013d3676f
MD5 1e7ba48c3633816445ed9af096872bc8
BLAKE2b-256 843814099d059ee6ae8bcb88b380db2738abf3c04bafe1288638984a928be9d7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page