Skip to main content

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

PyPi

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-1.0.1.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

selenium_enhancer-1.0.1-py3-none-any.whl (2.7 kB view hashes)

Uploaded Python 3

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