webdriver-0.5.1: a Haskell client for the Selenium WebDriver protocol

Safe HaskellNone

Test.WebDriver.Commands.Internal

Contents

Description

Internal functions used to implement the functions exported by Test.WebDriver.Commands. These may be useful for implementing non-standard webdriver commands.

Synopsis

Low-level webdriver functions

doCommandSource

Arguments

:: (WebDriver wd, ToJSON a, FromJSON b) 
=> RequestMethod

HTTP request method

-> Text

URL of request

-> a

JSON parameters passed in the body of the request. Note that, as a special case, anything that converts to Data.Aeson.Null will result in an empty request body.

-> wd b

The JSON result of the HTTP request.

Commands with :sessionId URL parameter

doSessCommand :: (WebDriver wd, ToJSON a, FromJSON b) => RequestMethod -> Text -> a -> wd bSource

This a convenient wrapper around doCommand that automatically prepends the session URL parameter to the wire command URL. For example, passing a URL of "refresh\" will expand to \"session:sessionIdrefresh", where :sessionId is a URL parameter as described in http://code.google.com/p/selenium/wiki/JsonWireProtocol

newtype SessionId Source

An opaque identifier for a WebDriver session. These handles are produced by the server on session creation, and act to identify a session in progress.

Constructors

SessionId Text 

Commands with element :id URL parameters

doElemCommand :: (WebDriver wd, ToJSON a, FromJSON b) => RequestMethod -> Element -> Text -> a -> wd bSource

A wrapper around doSessCommand to create element URLs. For example, passing a URL of /active will expand to "session:sessionIdelement:id/active", where :sessionId and :id are URL parameters as described in the wire protocol.

newtype Element Source

An opaque identifier for a web page element.

Constructors

Element Text 

Commands with :windowHandle URL parameters

doWinCommand :: (WebDriver wd, ToJSON a, FromJSON b) => RequestMethod -> WindowHandle -> Text -> a -> wd bSource

A wrapper around doSessCommand to create window handle URLS. For example, passing a URL of "/size" will expand to "session:sessionIdwindow:windowHandle/", where :sessionId and :windowHandle are URL parameters as described in the wire protocol

currentWindow :: WindowHandleSource

A special WindowHandle that always refers to the currently focused window. This is also used by the Default instance.

Exceptions

newtype NoSessionId Source

A command requiring a session ID was attempted when no session ID was available.

Constructors

NoSessionId String