Additional Abilities

ScreenPy Selenium adds one additional Ability, which enables Actors to use Selenium to browse the web.

BrowseTheWeb

class BrowseTheWeb(browser: WebDriver)

Use Selenium to enable browsing the web with a web browser.

Examples:

Perry = AnActor.named("Perry").who_can(
    BrowseTheWeb.using_firefox()
)

Perry = AnActor.named("Perry").who_can(
    BrowseTheWeb.using(driver)
)
classmethod using_chrome() Self

Create and use a default Chrome Selenium webdriver instance.

classmethod using_firefox() Self

Create and use a default Firefox Selenium webdriver instance.

classmethod using_safari() Self

Create and use a default Safari Selenium webdriver instance.

classmethod using_ios() Self

Create and use a default Remote driver instance.

Connects to a running Appium server and open Safari on iOS.

Note that Appium requires non-trivial setup to be able to connect to iPhone simulators. See the Appium documentation to get started: http://appium.io/docs/en/writing-running-appium/running-tests/

Environment Variables:
APPIUM_HUB_URL: the URL to look for the Appium server. Default

is “http://localhost:4723/wd/hub

IOS_DEVICE_VERSION: the version of the device to put in the

desired capabilities. This must be set.

IOS_DEVICE_NAME: the device name to request in the desired

capabilities. Default is “iPhone Simulator”

classmethod using_android() Self

Create and use a default Remote driver instance.

Connects to a running Appium server and open Chrome on Android.

Note that Appium requires non-trivial setup to be able to connect to Android emulators. See the Appium documentation to get started: http://appium.io/docs/en/writing-running-appium/running-tests/

Environment Variables:
APPIUM_HUB_URL: the URL to look for the Appium server. Default

is “http://localhost:4723/wd/hub

ANDROID_DEVICE_VERSION: the version of the device to put in

the desired capabilities. This must be set.

ANDROID_DEVICE_NAME: the device name to request in the desired

capabilities. Default is “Android Emulator”

classmethod using(browser: WebDriver) Self

Provide an already-set-up WebDriver to use to browse the web.