Page - Web page class

Pages are considered the scaffolding for interacting with web pages as a whole. While the class is not necessary in creating testing frameworks, it does contain a few useful functions such as validating that the browser is in view of that page. An example would look like:

from import Page
from sda.structures import *
from selenium import webdriver

class HelloWorld(Page):

    def __init__(self, driver):

        Page.__init__(self, driver, '/category/sub-category/page')  # Make sure that this is the path only = Button(driver, '//button[@id="buttonFoo"]')

wd = webdriver.Firefox()
h = HelloWorld(wd)

# Click 'Foo' button

class, url_path=u'/')

Bases: sda.element.SeleniumObject

The Page Implementation


Returns all testable elements on a page

Returns:Dictionary of WebElements
Return type:dict

Returns True if the driver is currently within the scope of this page

Returns:True, if driver on page
Return type:bool
static is_element(attrib=None)

Returns True if the class attribute is a valid locator

Parameters:attrib – Class attribute
Returns:True, if the class attribute is a valid locator
Return type:bool

Navigate to path


Return page title

Returns:Page title
Return type:str

Current page URL

Returns:Page URL
Return type:str