This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A webdriver / selenium wrapper focusing on code completion, good page class design, and logging.

Project Description

Website at: http://www.slickqa.com/webdriver/python Extensive documentation at: http://www.slickqa.com/webdriver/python/docs

Webdriver wrapper for SlickQA Project

Don’t let the name fool you, this wrapper can be used by any project. It was written by the people who brought you the slick project, hence the name. This wrapper has the purpose of making the selenium interface more reliable for tests with less, more readable code by:

  • Wrapping all actions with log statements (using python’s builtin logging framework) that detail everything it’s doing
  • Providing a nice readable api, making your tests readable
  • Waiting for elements to exist (with customizable timeout) so that you don’t have to
  • Providing a Page api that allows for easy organization of locators
  • Page api allows for flat (Page -> locator) and nested (FrameworkElement -> Page -> Container -> Locator) api
  • No need to instantiate every page class individually (avoiding boilerplate code)
  • Event based api where you can add your own pre and post actions as part of standard calls (like taking a screenshot on click)
  • more good tidbits

Example Usage

What does a test using this fabulous framework look like? Let me show you:

from slickwd import BrowserType, Browser, Container, WebElementLocator, Find
from nose import with_setup
from nose.tools import assert_regexp_matches

# Page Classes --------------------------------------------------
class GoogleSearchPage(Container):
    Search_Query_Text_Field = WebElementLocator("Search Box", Find.by_name("q"))
    Search_Button = WebElementLocator("Search Button", Find.by_name("btnG"))

    def is_current_page(self, browser):
        return browser.exists(GoogleSearchPage.Search_Query_Text_Field, timeout=0, log=False)

class SearchResultsPage(Container):
    Results_Div = WebElementLocator("Results Div", Find.by_id("ires"))

    def is_current_page(self, browser):
        return browser.exists(SearchResultsPage.Results_Div, timeout=0, log=False)

# Tests ---------------------------------------------------------
browser = None


def s():
    global browser
    if browser is not None:
        browser.quit()
    browser = Browser(BrowserType.FIREFOX)

def cleanup():
    global browser
    if browser is not None:
        browser.quit()

@with_setup(s, cleanup)
def test_google_search():
    global browser
    browser.go_to('http://www.google.com')
    browser.wait_for_page(GoogleSearchPage)
    browser.click_and_type(GoogleSearchPage.Search_Query_Text_Field, "Slick Test Manager")
    browser.click(GoogleSearchPage.Search_Button)
    browser.wait_for_page(SearchResultsPage)
    assert_regexp_matches(browser.get_page_text(), '.*SlickQA:.*')

The test is written so the code can be read, easily modified if something in the page is changed, and allow for code reuse (page classes). Normally page classes would be held in a different module for better organization. This is what is referred to in the documentation as the “static page class model”. There is also a different way to structure page classes that allows for nesting of containers (page classes) to make a hierarchy and enable code completion in IDEs.

Release History

Release History

This version
History Node

1.0.60

History Node

1.0.59

History Node

1.0.58

History Node

1.0.57

History Node

1.0.56

History Node

1.0.55

History Node

1.0.54

History Node

1.0.53

History Node

1.0.52

History Node

1.0.51

History Node

1.0.50

History Node

1.0.49

History Node

1.0.48

History Node

1.0.47

History Node

1.0.46

History Node

1.0.45

History Node

1.0.44

History Node

1.0.43

History Node

1.0.42

History Node

1.0.41

History Node

1.0.40

History Node

1.0.39

History Node

1.0.38

History Node

1.0.37

History Node

1.0.36

History Node

1.0.35

History Node

1.0.34

History Node

1.0.33

History Node

1.0.32

History Node

1.0.31

History Node

1.0.30

History Node

1.0.29

History Node

1.0.21

History Node

1.0.20

History Node

1.0.19

History Node

1.0.18

History Node

1.0.17

History Node

1.0.16

History Node

1.0.15

History Node

1.0.14

History Node

1.0.13

History Node

1.0.12

History Node

1.0.11

History Node

1.0.10

History Node

1.0.9

History Node

1.0.8

History Node

1.0.7

History Node

1.0.6

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0dev

History Node

1.0-n..2-

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
slick_webdriver-1.0.60-py2-none-any.whl (15.0 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Jun 5, 2017
slick_webdriver-1.0.60-py3-none-any.whl (15.0 kB) Copy SHA256 Checksum SHA256 3.5 Wheel Jun 5, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting