A package to streamline and enhance your Selenium code
Project description
Installation
pip install selenium-enhancer
Setting Up a Driver
After installing or whenver you need to update to the latest version of ChromeDriver, run:
python -m selenium_enhancer.get_latest_chrome_driver
ChromeDriver is recommended as it has more options, but Firefox and IE drivers are in theory compatible as well. Please feel free to contribute if you need additional functionality.
Getting Started
from selenium_enhancer import SeleniumEnhancer
class ClassName(SeleniumEnhancer):
def complete_web_form(self):
self.start_chrome_driver()
self.driver.get("full-url-of-page-with-form.com")
self.set_input_elements({
"id or CSS selector or XPath" : "value I want to set",
"second id or CSS selector or XPath" : "second value"
})
self.set_select_elements({
"name or id of select element" : "partial/complete text of option"
})
self.click_button("submitButtonId")
driver = ClassName()
driver.complete_web_form()
Examples
If you're cloning the repo to contribute, you can run/view/add to the tests
with at pytest tests -s -vv
.
Miscellaneous
Updating PyPi (notes to self)
- Update version number in setup.py
- Commit to Git
python setup.py sdist
twine upload --skip-existing dist/*
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
Close
Hashes for selenium_enhancer-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93c36a22d472ba0d2e0671689a51938ec64d96352c663c414565e4462fc32db7 |
|
MD5 | 9c5ad3b714e91ec47fdb7a576c8a9438 |
|
BLAKE2b-256 | 9587e5fee3eac62ea7a8d4befe703c0b4e58148f20284842694e1988a374861f |