webdriver-w3c-0.0.1: Bindings to the WebDriver API

Copyright2018 Automattic Inc.
LicenseGPL-3
MaintainerNathan Bloomfield (nbloomf@gmail.com)
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Web.Api.WebDriver.Endpoints

Contents

Description

These bindings try to stick as closely to the spec as possible. We use the following conventions.

  • The Stealth suffix on a function indicates that it does not log request or response data (but it does log that a request/response occurred).
  • A prime (') on a POST function name indicates that it takes an additional function parameter that mutates the payload after it is converted to JSON, but before sending the request. This is a cheap way to future-proof the bindings and accommodate nonstandard request parameters.

The most recent version of the spec is available at https://w3c.github.io/webdriver/webdriver-spec.html.

Synopsis

Documentation

runIsolated :: Monad m => Capabilities -> WebDriverT m a -> WebDriverT m () Source #

Run a WebDriver computation in an isolated browser session. Ensures that the session is closed on the remote end.

Sessions

New Session

newSession :: Monad m => Capabilities -> WebDriverT m SessionId Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#new-session. For an extensible version allowing arbitrary changes to the JSON value representing the Capabilities parameter, see newSession'.

newSession' :: Monad m => (Value -> Value) -> Capabilities -> WebDriverT m SessionId Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#new-session. This generalizes newSession' by taking an additional function Value -> Value that is applied to the Capabilities parameter after it is converted to JSON, but before it is passed to the HTTP call.

Delete Session

Status

Get Timeouts

Set Timeouts

Navigation

Navigate To

navigateTo :: Monad m => Url -> WebDriverT m () Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#navigate-to. To access this enpoint without logging the request or the result, use navigateToStealth.

navigateToStealth :: Monad m => Url -> WebDriverT m () Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#navigate-to. This function does not log the request or response; if you do want the interaction logged, use navigateTo.

Get Current URL

Go Back

Go Forward

Page Refresh

Get Title

Command Contexts

Get Window Handle

Close Window

Switch To Window

Get Window Handles

Switch To Frame

Switch To Parent Frame

Get Window Rect

Set Window Rect

Maximize Window

Minimize Window

Fullscreen Window

Element Retrieval

Find Element

Find Elements

Find Element From Element

Find Elements From Element

Get Active Element

Element State

Is Element Selected

Get Element Attribute

Get Element Property

Get Element CSS Value

Get Element Text

Get Element Tag Name

Get Element Rect

Is Element Enabled

Element Interaction

Element Click

Element Clear

Element Send Keys

Document Handling

Get Page Source

Execute Script

Execute Async Script

Cookies

Get All Cookies

Get Named Cookie

Add Cookie

Delete Cookie

Delete All Cookies

Actions

Perform Actions

performActions :: Monad m => [Action] -> WebDriverT m () Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#perform-actions. For a variant on this endpoint that does not log the request and response, see performActionsStealth.

performActionsStealth :: Monad m => [Action] -> WebDriverT m () Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#perform-actions. This function is identical to performActions except that it does not log the request or response. Handy if the action includes secret info.

Release Actions

User Prompts

Dismiss Alert

Accept Alert

Get Alert Text

Send Alert Text

Screen Capture

Take Screenshot

Take Element Screenshot

_WEB_ELEMENT_ID :: Text Source #

Spec-defined "web element identifier" string constant. See https://w3c.github.io/webdriver/webdriver-spec.html#elements.

_WEB_WINDOW_ID :: Text Source #

Spec-defined "web window identifier" string constant. See https://w3c.github.io/webdriver/webdriver-spec.html#command-contexts.

_WEB_FRAME_ID :: Text Source #

Spec-defined "web frame identifier" string constant. See https://w3c.github.io/webdriver/webdriver-spec.html#command-contexts.