Developer Interface

This part of the documentation describes the interfaces for using FoxPuppet.

FoxPuppet

class foxpuppet.foxpuppet.FoxPuppet(selenium)[source]

Class that sets up the interface for interacting with the Firefox browser.

Parameters:selenium (WebDriver) – WebDriver object

Windows

This module contains all of the window types as well as the window manager.

Window Manager

class foxpuppet.windows.WindowManager(selenium)[source]

A window manager that controls the creation of window objects for interaction.

Parameters:selenium (WebDriver) – WebDriver object.

Browser Window

class foxpuppet.windows.browser.window.BrowserWindow(selenium, handle)[source]

Representation of a browser window.

close()

Closes the window.

document_element

Returns the inner DOM window element.

Returns:DOM window element.
Return type:WebDriver locator
firefox_version

Major version of Firefox in use.

Returns:Major component of the Firefox version.
Return type:int
is_private

Property that checks if the specified window is private or not.

Returns:True if this is a Private Browsing window.
Return type:bool
navbar

Provides access to the Navigation Bar. :returns: NavBar :return type: object

notification

Provides access to the currently displayed notification.

open_window(private=False)[source]

Opens a new browser window

Parameters:private (bool) – Optional parameter to open a private browsing window. Defaults to False.
Returns:BrowserWindow object of the newly opened window.
Return type:object
switch_to()

Switches focus for Selenium commands to this window.

wait_for_notification(notification_class=<class 'foxpuppet.windows.browser.notifications.base.BaseNotification'>)[source]

Waits for the specified notification to be displayed.

Parameters:notification_class – Optional, the notification class to wait for. If None is specified it will wait for any notification to be closed. Defaults to BaseNotification.