A Selenium Page Factory implementation for Python
Project description
selenium-pagefactory-impl
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file selenium_pagefactory_impl-0.1.0.tar.gz
.
File metadata
- Download URL: selenium_pagefactory_impl-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.0 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40df4a58c85e363d2f169f056efa0efb06ff607b1fed77c21910fa6f42493b4d |
|
MD5 | 843b84435c0da67733b5697931f6fc1f |
|
BLAKE2b-256 | bf4c4354458ef0db56be23c4b868bbda4f0cdf08bb7eeb2b8d9492cf220ed70d |
File details
Details for the file selenium_pagefactory_impl-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: selenium_pagefactory_impl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.0 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 950e8ec6d5022704862880112e72890541b17ae7baffb3d4e9dcc25013d3676f |
|
MD5 | 1e7ba48c3633816445ed9af096872bc8 |
|
BLAKE2b-256 | 843814099d059ee6ae8bcb88b380db2738abf3c04bafe1288638984a928be9d7 |