aamras package

Module contents

aamras.create_driver(driver_type: Optional[aamras.driver.factory.DriverType] = None)

Construct driver with the provided driver type.

Parameters:driver_type – type of driver to construct.
class aamras.Driver(driver: selenium.webdriver.remote.webdriver.WebDriver)[source]

Bases: aamras.util.logger.LoggerMixin, aamras.driver.cookies.CookieManagerMixin, aamras.driver.element.ElementTraverserMixin

Abstraction/wrapper of selenium WebDriver.

click(id_: Optional[str] = None, name: Optional[str] = None, class_: Optional[str] = None, tag: Optional[str] = None) → None[source]

Click an element matching provided criteria.

See element() for documentation on criteria.

close()[source]

Save cookies and shut down driver.

dom_root
get(url: str) → None[source]

Navigate to a provided url.

Parameters:url – relative or absolute path, or full URL to navigate to
log_page() → None[source]

Write page information to log.

save_source(file_path: str) → None[source]

Save source code of current page.

Parameters:file_path – path of file to save source to
screenshot(file_path: str)[source]

Save a screenshot of the browser window.

Parameters:file_path – path of file to save screenshot to
submit(id_: Optional[str] = None, name: Optional[str] = None, class_: Optional[str] = None, tag: Optional[str] = None) → None[source]

Submit an element matching provided criteria.

See element() for documentation on criteria.

title

Title of the current page.

type(id_: Optional[str] = None, name: Optional[str] = None, class_: Optional[str] = None, text: Optional[str] = None) → None[source]

Send text input to an element matching provided criteria.

See element() for documentation on criteria.

url

Current URL.

class aamras.DriverFactory[source]

Bases: aamras.util.logger.LoggerMixin

create(driver_type: Optional[aamras.driver.factory.DriverType] = None) → aamras.driver.driver.Driver[source]

Construct driver with the provided driver type.

Parameters:driver_type – type of driver to construct.
class aamras.DriverType[source]

Bases: str, enum.Enum

Common driver types.

CHROME = 'chrome'
FIREFOX = 'firefox'
class aamras.Element(element: selenium.webdriver.remote.webelement.WebElement)[source]

Bases: aamras.util.logger.LoggerMixin, aamras.driver.element.ElementTraverserMixin

Wrapper for selenium WebElement.

attribute(name: str) → Optional[str][source]
class_
clear() → None[source]

Clear element’s text, if present.

click() → None[source]

Click the element.

description
displayed
dom_root
enabled
id
name
screenshot(file_path: str) → None[source]

Save screenshot of element.

Parameters:file_path – path of file to save screenshot to
selected
submit() → None[source]

Submit the element.

tag
text
type(text: Optional[str]) → None[source]

Send text input to the element.