Skip to main content

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

PyPi

Updating PyPi (notes to self)

  1. Update version number in setup.py
  2. Commit to Git
  3. python setup.py sdist
  4. twine upload --skip-existing dist/*

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_enhancer-0.2.21.tar.gz (5.5 kB view hashes)

Uploaded Source

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