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
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_enhancer-1.0.1.tar.gz
.
File metadata
- Download URL: selenium_enhancer-1.0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2be06233d8e58da1b85cef1476e22400be72df8bc3e343dbf5f71298dca0415a |
|
MD5 | 1f42c49f3868c35700dd91b09e9cc371 |
|
BLAKE2b-256 | f4d89f4cb77b2928ac80368c0e15bb62d1b159e4b2c0ce7eb906d8c93766e676 |
File details
Details for the file selenium_enhancer-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: selenium_enhancer-1.0.1-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 139dfcd87a8847bdbbd7e300124037150344349a0df4046f1f65030ad691e034 |
|
MD5 | 0a9f10e6351a57154ba5d11811f474e4 |
|
BLAKE2b-256 | e375d3745af03a6d5fa291c80f9225ae4070cdc1bc6dd5be21d3d40f4ccd3d45 |