A package to enhance your Selenium WebDriver experience
Project description
Installation
pip install selenium-enhancer
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()
Setting Up a Driver
ChromeDriver is recommended as it has more options, but Firefox and IE drivers are compatible as well. Set the path to your chosen driver as a system environment variable named CHROME_DRIVER FIREFOX_DRIVER, or IE_DRIVER.
Examples
See/run examples.py
for usage examples.
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.