webdriver_test_tools.pageobject.base module

class webdriver_test_tools.pageobject.base.BasePage(driver)[source]

Bases: object

Base class for page objects

class Locator[source]

Bases: object

WebDriver locator tuples for any elements that will need to be accessed by this page object.

Example
SOME_ELEMENT = (By.ID, 'some-element')

This nested class is not technically required, but for consistency it’s recommended to use this convention for storing locators relevant to a page object

find_element(locator)[source]

Returns a WebElement object based on the locator tuple passed

Shorthand for:

self.driver.find_element(*locator)
Parameters

locator – WebDriver locator tuple in the format (By.<attr>, <locator string>)

Returns

The located WebElement

find_elements(locator)[source]

Returns a list of WebElement objects based on the locator tuple passed

Shorthand for :

self.driver.find_elements(*locator)
Parameters

locator – WebDriver locator tuple in the format (By.<attr>, <locator string>)

Returns

List of located WebElements