HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

  • Packagewebdriver-0.12.0.1
  • Exports115
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceCommands.hs

Sessions

4 declarations

Browser interaction

0 declarations

Web navigation

Page info

Timeouts

3 declarations

Web elements

2 declarations
newtypenewtype Element
#

An opaque identifier for a web page element.

Constructors

Instances6Eq, Ord, Read, Show, FromJSON, ToJSON
  • Eq ElementDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands.Internal
  • Ord ElementDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands.Internal
  • Read ElementDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands.Internal
  • Show ElementDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands.Internal
  • FromJSON ElementDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands.Internal
  • ToJSON ElementDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands.Internal
datadata Selector
#

Specifies element(s) within a DOM tree using various selection methods.

Constructors

Instances4Eq, Ord, Show, ToJSON
  • Eq SelectorDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands
  • Ord SelectorDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands
  • Show SelectorDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands
  • ToJSON SelectorDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands

Searching for elements

Interacting with elements

Sending key inputs to elements

valuesendRawKeys :: (HasCallStack, WebDriver wd) => Text -> wd ()
#

Similar to sendKeys, but doesn't implicitly release modifier keys afterwards. This allows you to combine modifiers with mouse clicks.

Element information

valueelemInfo :: (HasCallStack, WebDriver wd) => Element -> wd Value
#

Deprecated. This command does not work with Marionette (Firefox) driver, and is likely to be completely removed in Selenium 4

Describe the element. Returns a JSON object whose meaning is currently undefined by the WebDriver protocol.

Element equality

Javascript

3 declarations
valueexecuteJS
  1. :: (Foldable f, FromJSON a, WebDriver wd)
  2. => f JSArg
  3. -> Text
  4. -> wd a
#

Inject a snippet of Javascript into the page for execution in the context of the currently selected frame. The executed script is assumed to be synchronous and the result of evaluating the script is returned and converted to an instance of FromJSON.

The first parameter defines a sequence of arguments to pass to the javascript function. Arguments of type Element will be converted to the corresponding DOM element. Likewise, any elements in the script result will be returned to the client as Elements.

The second parameter defines the script itself in the form of a function body. The value returned by that function will be returned to the client. The function will be invoked with the provided argument list and the values may be accessed via the arguments object in the order specified.

When using executeJS, GHC might complain about an ambiguous type in situations where the result of the executeJS call is ignored/discard. Consider the following example:

	jsExample = do
		e <- findElem (ById "foo")
		executeJS [] "someAction()"
		return e

Because the result of the executeJS is discarded, GHC cannot resolve which instance of the fromJSON class to use when parsing the Selenium server response. In such cases, we can use the ignoreReturn helper function located in Test.WebDriver.JSON. ignoreReturn has no runtime effect; it simply helps the type system by expicitly providing a fromJSON instance to use.

	import Test.WebDriver.JSON (ignoreReturn)
	jsExample = do
		e <- findElem (ById "foo")
		ignoreReturn $ executeJS [] "someAction()"
		return e
valueasyncJS
  1. :: (HasCallStack, Foldable f, FromJSON a, WebDriver wd)
  2. => f JSArg
  3. -> Text
  4. -> wd (Maybe a)
#

Executes a snippet of Javascript code asynchronously. This function works similarly to executeJS, except that the Javascript is passed a callback function as its final argument. The script should call this function to signal that it has finished executing, passing to it a value that will be returned as the result of asyncJS. A result of Nothing indicates that the Javascript function timed out (see setScriptTimeout)

datadata JSArg
#

An existential wrapper for any ToJSON instance. This allows us to pass parameters of many different types to Javascript code.

Constructors

Instances1ToJSON
  • ToJSON JSArgDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands

Windows

11 declarations
newtypenewtype WindowHandle
#

An opaque identifier for a browser window

Constructors

Instances7Eq, Ord, Read, Show, FromJSON, ToJSON, …

Focusing on frames

2 declarations
datadata FrameSelector
#

Specifies the frame used by focusFrame

Constructors

Instances4Eq, Read, Show, ToJSON

Cookies

7 declarations
datadata Cookie
#

Cookies are delicious delicacies. When sending cookies to the server, a value of Nothing indicates that the server should use a default value. When receiving cookies from the server, a value of Nothing indicates that the server is unable to specify the value.

Constructors

Instances6Eq, Show, Generic, FromJSON, ToJSON, Rep
valuemkCookie :: Text -> Text -> Cookie
#

Creates a Cookie with only a name and value specified. All other fields are set to Nothing, which tells the server to use default values.

valuesetCookie :: (HasCallStack, WebDriver wd) => Cookie -> wd ()
#

Set a cookie. If the cookie path is not specified, it will default to "/". Likewise, if the domain is omitted, it will default to the current page's domain

Alerts

4 declarations

Mouse gestures

9 declarations
datadata MouseButton
#
Instances7Bounded, Enum, Eq, Ord, Show, FromJSON, …
valuemouseDown :: (HasCallStack, WebDriver wd) => wd ()
#

Press and hold the left mouse button down. Note that undefined behavior occurs if the next mouse command is not mouseUp.

valuewithMouseDown :: (HasCallStack, WebDriver wd) => wd a -> wd a
#

Perform the given action with the left mouse button held down. The mouse is automatically released afterwards.

HTML 5 Web Storage

7 declarations
valuegetKey :: (HasCallStack, WebDriver wd) => WebStorageType -> Text -> wd Text
#

Get the value associated with a key in the given web storage area. Unset keys result in empty strings, since the Web Storage spec makes no distinction between the empty string and an undefined value.

HTML 5 Application Cache

2 declarations
Instances7Bounded, Enum, Eq, Ord, Read, Show, …

Mobile device support

0 declarations

Screen orientation

datadata Orientation
#

A screen orientation

Instances7Bounded, Enum, Eq, Ord, Show, FromJSON, …

Geo-location

Touch gestures

valuetouchFlick :: (HasCallStack, WebDriver wd) => (Int, Int) -> wd ()
#

Emulate a flick on the touch screen. The coordinates indicate x and y velocity, respectively. Use this function if you don't care where the flick starts.

IME support

5 declarations

Uploading files to remote server

3 declarations

These functions allow you to upload a file to a remote server. Note that this operation isn't supported by all WebDriver servers, and the location where the file is stored is not standardized.

valueuploadZipEntry :: (HasCallStack, WebDriver wd) => Entry -> wd ()
#

Lowest level interface to the file uploading mechanism. This allows you to specify the exact details of the zip entry sent across network.

Server information and logs

6 declarations
valuegetLogs :: (HasCallStack, WebDriver wd) => LogType -> wd [LogEntry]
#

Retrieve the log buffer for a given log type. The server-side log buffer is reset after each request.

Which log types are available is server defined, but the wire protocol lists these as common log types: client, driver, browser, server

datadata LogEntry
#

A record that represents a single log entry.

Constructors

Instances5Eq, Ord, Read, Show, FromJSON
  • Eq LogEntryDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands
  • Ord LogEntryDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands
  • Read LogEntryDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands
  • Show LogEntryDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands
  • FromJSON LogEntryDefined in webdriver-0.12.0.1 · Test.WebDriver.Commands
datadata LogLevel
#

Indicates a log verbosity level. Used in Firefox and Opera configuration.

Instances9Bounded, Enum, Eq, Ord, Read, Show, …
  • Bounded LogLevelDefined in webdriver-0.12.0.1 · Test.WebDriver.Capabilities
  • Enum LogLevelDefined in webdriver-0.12.0.1 · Test.WebDriver.Capabilities
  • Eq LogLevelDefined in webdriver-0.12.0.1 · Test.WebDriver.Capabilities
  • Ord LogLevelDefined in webdriver-0.12.0.1 · Test.WebDriver.Capabilities
  • Read LogLevelDefined in webdriver-0.12.0.1 · Test.WebDriver.Capabilities
  • Show LogLevelDefined in webdriver-0.12.0.1 · Test.WebDriver.Capabilities
  • FromJSON LogLevelDefined in webdriver-0.12.0.1 · Test.WebDriver.Capabilities
  • ToJSON LogLevelDefined in webdriver-0.12.0.1 · Test.WebDriver.Capabilities
  • Default LogLevelDefined in webdriver-0.12.0.1 · Test.WebDriver.Capabilities