webdriver
Safe HaskellNone
LanguageHaskell2010

Test.WebDriver.Commands

Description

This module exports all the actions that can be used to interact with a browser session.

Synopsis

Sessions

A session is equivalent to a single instantiation of a particular user agent, including all its child browsers. WebDriver gives each session a unique session ID that can be used to differentiate one session from another, allowing multiple user agents to be controlled from a single HTTP server, and allowing sessions to be routed via a multiplexer (known as an intermediary node).

See https://www.w3.org/TR/webdriver1/#sessions.

getTimeouts :: (HasCallStack, WebDriver wd) => wd Timeouts Source #

Get all the Timeouts simultaneously.

serverStatus :: (HasCallStack, WebDriver wd) => wd Value Source #

Get information from the server as a JSON Object. For more information about this object see https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#status

setImplicitWait :: (HasCallStack, WebDriver wd) => Integer -> wd () Source #

Set the "implicit" value of the Timeouts.

setPageLoadTimeout :: (HasCallStack, WebDriver wd) => Integer -> wd () Source #

Set the "pageLoad" value of the Timeouts.

setScriptTimeout :: (HasCallStack, WebDriver wd) => Maybe Integer -> wd () Source #

Set the "script" value of the Timeouts. Selenium 3 and 4 accept null for this value, which unsets it. The spec doesn't mention this.

setTimeouts :: (HasCallStack, WebDriver wd) => Timeouts -> wd () Source #

Set all the Timeouts simultaneously.

data Timeouts Source #

Constructors

Timeouts 

Fields

Navigation

The commands in this section allow navigation of the current top-level browsing context to new URLs and introspection of the document currently loaded in this browsing context.

See https://www.w3.org/TR/webdriver1/#navigation.

back :: (HasCallStack, WebDriver wd) => wd () Source #

Navigate backward in the browser history.

forward :: (HasCallStack, WebDriver wd) => wd () Source #

Navigate forward in the browser history.

getCurrentURL :: (HasCallStack, WebDriver wd) => wd String Source #

Gets the URL of the current page.

getTitle :: (HasCallStack, WebDriver wd) => wd Text Source #

Get the title of the current page.

openPage :: (HasCallStack, WebDriver wd) => String -> wd () Source #

Opens a new page by the given URL.

refresh :: (HasCallStack, WebDriver wd) => wd () Source #

Refresh the current page

Command contexts

Many WebDriver commands happen in the context of either the current browsing context or current top-level browsing context. The current top-level browsing context is represented in the protocol by its associated window handle. When a top-level browsing context is selected using the Switch To Window command, a specific browsing context can be selected using the Switch to Frame command.

See https://www.w3.org/TR/webdriver1/#command-contexts.

closeWindow :: (HasCallStack, WebDriver wd) => WindowHandle -> wd () Source #

Closes the given window

focusFrame :: (HasCallStack, WebDriver wd) => FrameSelector -> wd () Source #

Switch focus to the frame specified by the FrameSelector.

focusParentFrame :: (HasCallStack, WebDriver wd) => wd () Source #

Switch focus to the frame specified by the FrameSelector.

focusWindow :: (HasCallStack, WebDriver wd) => WindowHandle -> wd () Source #

Switch to a given window

fullscreen :: (HasCallStack, WebDriver wd) => wd () Source #

Fullscreens the current window

getCurrentWindow :: (HasCallStack, WebDriver wd) => wd WindowHandle Source #

Returns a handle to the currently focused window

getWindowRect :: (HasCallStack, WebDriver wd) => wd Rect Source #

Get the dimensions of the current window.

maximize :: (HasCallStack, WebDriver wd) => wd () Source #

Maximizes the current window

minimize :: (HasCallStack, WebDriver wd) => wd () Source #

Minimizes the current window

setWindowRect :: (HasCallStack, WebDriver wd) => Rect -> wd () Source #

Set the dimensions of the current window.

windows :: (HasCallStack, WebDriver wd) => wd [WindowHandle] Source #

Returns a list of all windows available to the session

data Rect Source #

Constructors

Rect 

Instances

Instances details
FromJSON Rect Source # 
Instance details

Defined in Test.WebDriver.Commands.CommandContexts

ToJSON Rect Source # 
Instance details

Defined in Test.WebDriver.Commands.CommandContexts

Show Rect Source # 
Instance details

Defined in Test.WebDriver.Commands.CommandContexts

Methods

showsPrec :: Int -> Rect -> ShowS #

show :: Rect -> String #

showList :: [Rect] -> ShowS #

Eq Rect Source # 
Instance details

Defined in Test.WebDriver.Commands.CommandContexts

Methods

(==) :: Rect -> Rect -> Bool #

(/=) :: Rect -> Rect -> Bool #

Ord Rect Source # 
Instance details

Defined in Test.WebDriver.Commands.CommandContexts

Methods

compare :: Rect -> Rect -> Ordering #

(<) :: Rect -> Rect -> Bool #

(<=) :: Rect -> Rect -> Bool #

(>) :: Rect -> Rect -> Bool #

(>=) :: Rect -> Rect -> Bool #

max :: Rect -> Rect -> Rect #

min :: Rect -> Rect -> Rect #

newtype WindowHandle Source #

An opaque identifier for a browser window

Constructors

WindowHandle Text 

Instances

Instances details
FromJSON WindowHandle Source # 
Instance details

Defined in Test.WebDriver.Util.Commands

ToJSON WindowHandle Source # 
Instance details

Defined in Test.WebDriver.Util.Commands

Read WindowHandle Source # 
Instance details

Defined in Test.WebDriver.Util.Commands

Show WindowHandle Source # 
Instance details

Defined in Test.WebDriver.Util.Commands

Eq WindowHandle Source # 
Instance details

Defined in Test.WebDriver.Util.Commands

Ord WindowHandle Source # 
Instance details

Defined in Test.WebDriver.Util.Commands

Element Retrieval

The Find Element, Find Elements, Find Element From Element, and Find Elements From Element commands allow lookup of individual elements and collections of elements. Element retrieval searches are performed using pre-order traversal of the document’s nodes that match the provided selector’s expression. Elements are serialized and returned as web elements.

See https://www.w3.org/TR/webdriver1/#element-retrieval.

activeElem :: (HasCallStack, WebDriver wd) => wd Element Source #

Return the element that currently has focus.

findElem :: (HasCallStack, WebDriver wd) => Selector -> wd Element Source #

Find an element on the page using the given element selector.

findElemFrom :: (HasCallStack, WebDriver wd) => Element -> Selector -> wd Element Source #

Search for an element using the given element as root.

findElems :: (HasCallStack, WebDriver wd) => Selector -> wd [Element] Source #

Find all elements on the page matching the given selector.

findElemsFrom :: (HasCallStack, WebDriver wd) => Element -> Selector -> wd [Element] Source #

Find all elements matching a selector, using the given element as root.

data Selector Source #

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

newtype Element Source #

An opaque identifier for a web page element

Constructors

Element Text 

Element State

attr :: (HasCallStack, WebDriver wd) => Element -> Text -> wd (Maybe Text) Source #

Retrieve the value of an element's attribute

cssProp :: (HasCallStack, WebDriver wd) => Element -> Text -> wd (Maybe Text) Source #

Retrieve the value of an element's computed CSS property

elemRect :: (HasCallStack, WebDriver wd) => Element -> wd Rect Source #

Retrieve an element's current position.

getText :: (HasCallStack, WebDriver wd) => Element -> wd Text Source #

Get all visible text within this element.

isEnabled :: (HasCallStack, WebDriver wd) => Element -> wd Bool Source #

Determine if the element is enabled.

isSelected :: (HasCallStack, WebDriver wd) => Element -> wd Bool Source #

Determine if the element is selected.

prop :: (HasCallStack, WebDriver wd) => Element -> Text -> wd (Maybe Value) Source #

Retrieve the value of an element's property

tagName :: (HasCallStack, WebDriver wd) => Element -> wd Text Source #

Return the tag name of the given element.

Element Interaction

clearInput :: (HasCallStack, WebDriver wd) => Element -> wd () Source #

Clear a textarea or text input element's value.

click :: (HasCallStack, WebDriver wd) => Element -> wd () Source #

Click on an element.

sendKeys :: (HasCallStack, WebDriver wd) => Text -> Element -> wd () Source #

Send a sequence of keystrokes to an element. All modifier keys are released at the end of the function. Named constants for special modifier keys can be found in Test.WebDriver.Keys

Document handling

asyncJS :: (HasCallStack, Foldable f, FromJSON a, WebDriver wd) => f JSArg -> Text -> wd (Maybe a) Source #

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)

executeJS :: (HasCallStack, Foldable f, FromJSON a, WebDriver wd) => f JSArg -> Text -> wd a Source #

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 (ByCSS "#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 (ByCSS "#foo")
		ignoreReturn $ executeJS [] "someAction()"
		return e

getSource :: (HasCallStack, WebDriver wd) => wd Text Source #

Get the current page source

data JSArg Source #

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

Constructors

ToJSON a => JSArg a 

Instances

Instances details
ToJSON JSArg Source # 
Instance details

Defined in Test.WebDriver.Commands.DocumentHandling

ignoreReturn :: WebDriver m => m Value -> m () Source #

Convenience function to ignore result of a webdriver command.

Cookies

cookie :: (HasCallStack, WebDriver wd) => Text -> wd Cookie Source #

Retrieve a specific cookie by name.

cookies :: (HasCallStack, WebDriver wd) => wd [Cookie] Source #

Retrieve all cookies.

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

Delete a cookie by name.

deleteCookies :: (HasCallStack, WebDriver wd) => wd () Source #

Delete all visible cookies on the current page.

mkCookie :: Text -> Text -> Cookie Source #

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.

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

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.

data Cookie Source #

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

Cookie 

Fields

Instances

Instances details
FromJSON Cookie Source # 
Instance details

Defined in Test.WebDriver.Commands.Cookies

ToJSON Cookie Source # 
Instance details

Defined in Test.WebDriver.Commands.Cookies

Generic Cookie Source # 
Instance details

Defined in Test.WebDriver.Commands.Cookies

Associated Types

type Rep Cookie 
Instance details

Defined in Test.WebDriver.Commands.Cookies

type Rep Cookie = D1 ('MetaData "Cookie" "Test.WebDriver.Commands.Cookies" "webdriver-0.14.0.0-7VuTGI1Nbgb7OmdaES2yso" 'False) (C1 ('MetaCons "Cookie" 'PrefixI 'True) ((S1 ('MetaSel ('Just "cookName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "cookValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "cookPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))) :*: (S1 ('MetaSel ('Just "cookDomain") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "cookSecure") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "cookExpiry") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double))))))

Methods

from :: Cookie -> Rep Cookie x #

to :: Rep Cookie x -> Cookie #

Show Cookie Source # 
Instance details

Defined in Test.WebDriver.Commands.Cookies

Eq Cookie Source # 
Instance details

Defined in Test.WebDriver.Commands.Cookies

Methods

(==) :: Cookie -> Cookie -> Bool #

(/=) :: Cookie -> Cookie -> Bool #

type Rep Cookie Source # 
Instance details

Defined in Test.WebDriver.Commands.Cookies

type Rep Cookie = D1 ('MetaData "Cookie" "Test.WebDriver.Commands.Cookies" "webdriver-0.14.0.0-7VuTGI1Nbgb7OmdaES2yso" 'False) (C1 ('MetaCons "Cookie" 'PrefixI 'True) ((S1 ('MetaSel ('Just "cookName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "cookValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "cookPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))) :*: (S1 ('MetaSel ('Just "cookDomain") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "cookSecure") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "cookExpiry") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double))))))

Actions

clickCenter :: (HasCallStack, WebDriver wd) => Element -> wd () Source #

Helper to click the center of an element.

doubleClickCenter :: (HasCallStack, WebDriver wd) => Element -> wd () Source #

Helper to double click the center of an element.

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

Moves the mouse to the given position relative to the current pointer position.

moveToCenter :: (HasCallStack, WebDriver wd) => Element -> wd () Source #

Moves the mouse to the center of a given element.

moveToFrom :: (HasCallStack, WebDriver wd) => (Int, Int) -> Element -> wd () Source #

Moves the mouse to the given position relative to the given element.

performActions :: (HasCallStack, WebDriver wd) => [ActionSource] -> wd () Source #

Perform a sequence of actions from multiple input sources

releaseActions :: (HasCallStack, WebDriver wd) => wd () Source #

Release all currently pressed keys and buttons

data Action Source #

Generic action that can be pause, pointer, or key

Instances

Instances details
Show Action Source # 
Instance details

Defined in Test.WebDriver.Commands.Actions

Eq Action Source # 
Instance details

Defined in Test.WebDriver.Commands.Actions

Methods

(==) :: Action -> Action -> Bool #

(/=) :: Action -> Action -> Bool #

data ActionSource Source #

Action source (input device)

Constructors

PointerSource 

Fields

KeySource 

Fields

data KeyAction Source #

Individual key actions

Constructors

KeyDown 

Fields

KeyUp 

Fields

Instances

Instances details
Show KeyAction Source # 
Instance details

Defined in Test.WebDriver.Commands.Actions

Eq KeyAction Source # 
Instance details

Defined in Test.WebDriver.Commands.Actions

data MouseButton Source #

A mouse button

Instances

Instances details
FromJSON MouseButton Source # 
Instance details

Defined in Test.WebDriver.Commands.Actions

ToJSON MouseButton Source # 
Instance details

Defined in Test.WebDriver.Commands.Actions

Bounded MouseButton Source # 
Instance details

Defined in Test.WebDriver.Commands.Actions

Enum MouseButton Source # 
Instance details

Defined in Test.WebDriver.Commands.Actions

Show MouseButton Source # 
Instance details

Defined in Test.WebDriver.Commands.Actions

Eq MouseButton Source # 
Instance details

Defined in Test.WebDriver.Commands.Actions

Ord MouseButton Source # 
Instance details

Defined in Test.WebDriver.Commands.Actions

User Prompts

acceptAlert :: (HasCallStack, WebDriver wd) => wd () Source #

Accepts the currently displayed alert dialog.

dismissAlert :: (HasCallStack, WebDriver wd) => wd () Source #

Dismisses the currently displayed alert dialog.

getAlertText :: (HasCallStack, WebDriver wd) => wd Text Source #

Get the text of an alert dialog.

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

Sends keystrokes to Javascript prompt() dialog.

Screen capture

saveScreenshot :: (HasCallStack, WebDriver wd) => FilePath -> wd () Source #

Save a screenshot to a particular location.

screenshot :: (HasCallStack, WebDriver wd) => wd ByteString Source #

Grab a screenshot of the current page as a PNG image.

screenshotElement :: (HasCallStack, WebDriver wd) => Element -> wd ByteString Source #

Grab a screenshot of the current page as a PNG image.

Browser logs

Retrieve browser console logs and other log types.

getLogs :: (HasCallStack, WebDriver wd) => LogType -> wd [LogEntry] Source #

Retrieve logs of a specific type from the browser. The W3C spec doesn't define how to do this natively, so we automatically detect the browser and try to use an appropriate method:

  • Chrome/Chromium: Chrome DevTools Protocol (CDP)
  • Firefox: legacy log endpoint (/log)
  • Selenium: legacy log endpoint (/log)
  • Other browsers: returns empty list

Common log types: browser, driver, performance, server.

However, the modern way to do this is via withRecordLogsViaBiDi.

withRecordLogsViaBiDi :: (WebDriver m, MonadLogger m) => (LogEntry -> m ()) -> m a -> m a Source #

Wrapper around withRecordLogsViaBiDi' which uses the WebSocket URL from the current Session. You must make sure to pass _capabilitiesWebSocketUrl = Just True to enable this. This will not work with Selenium 3.

withRecordLogsViaBiDi' :: (MonadUnliftIO m, MonadLogger m) => URI -> (LogEntry -> m ()) -> m a -> m a Source #

Connect to WebSocket URL and subscribe to log events using the W3C BiDi protocol; see https://w3c.github.io/webdriver-bidi/.

data LogEntry Source #

A record that represents a single log entry.

Constructors

LogEntry 

Fields

data LogLevel Source #

Indicates a log verbosity level.

Instances

Instances details
FromJSON LogLevel Source # 
Instance details

Defined in Test.WebDriver.Commands.Logs.Common

ToJSON LogLevel Source # 
Instance details

Defined in Test.WebDriver.Commands.Logs.Common

Bounded LogLevel Source # 
Instance details

Defined in Test.WebDriver.Commands.Logs.Common

Enum LogLevel Source # 
Instance details

Defined in Test.WebDriver.Commands.Logs.Common

Read LogLevel Source # 
Instance details

Defined in Test.WebDriver.Commands.Logs.Common

Show LogLevel Source # 
Instance details

Defined in Test.WebDriver.Commands.Logs.Common

Eq LogLevel Source # 
Instance details

Defined in Test.WebDriver.Commands.Logs.Common

Ord LogLevel Source # 
Instance details

Defined in Test.WebDriver.Commands.Logs.Common

Selenium-specific

Mobile device support

getLocation :: (HasCallStack, WebDriver wd) => wd (Int, Int, Int) Source #

Get the current geographical location of the device.

getOrientation :: (HasCallStack, WebDriver wd) => wd Orientation Source #

Get the current screen orientation for rotatable display devices.

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

Set the current geographical location of the device.

setOrientation :: (HasCallStack, WebDriver wd) => Orientation -> wd () Source #

Set the current screen orientation for rotatable display devices.

touchClick :: (HasCallStack, WebDriver wd) => Element -> wd () Source #

Single tap on the touch screen at the given element's location.

touchDoubleClick :: (HasCallStack, WebDriver wd) => Element -> wd () Source #

Emulate a double click on a touch device.

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

Emulates pressing a finger down on the screen at the given location.

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

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.

touchFlickFrom Source #

Arguments

:: (HasCallStack, WebDriver wd) 
=> Int

flick velocity

-> (Int, Int)

a location relative to the given element

-> Element

the given element

-> wd () 

Emulate a flick on the touch screen.

touchLongClick :: (HasCallStack, WebDriver wd) => Element -> wd () Source #

Emulate a long click on a touch device.

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

Emulates moving a finger on the screen to the given location.

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

Emulate finger-based touch scroll. Use this function if you don't care where the scroll begins

touchScrollFrom :: (HasCallStack, WebDriver wd) => (Int, Int) -> Element -> wd () Source #

Emulate finger-based touch scroll, starting from the given location relative to the given element.

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

Emulates removing a finger from the screen at the given location.

data Orientation Source #

A screen orientation

Constructors

Landscape 
Portrait 

Instances

Instances details
FromJSON Orientation Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.Mobile

ToJSON Orientation Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.Mobile

Bounded Orientation Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.Mobile

Enum Orientation Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.Mobile

Show Orientation Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.Mobile

Eq Orientation Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.Mobile

Ord Orientation Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.Mobile

Uploading files to remote server

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.

seleniumUploadFile :: (HasCallStack, WebDriver wd) => FilePath -> wd Text Source #

Uploads a file from the local filesystem by its file path. Returns the remote filepath of the file.

seleniumUploadRawFile Source #

Arguments

:: (HasCallStack, WebDriver wd) 
=> FilePath

File path to use with this bytestring.

-> Integer

Modification time (in seconds since Unix epoch).

-> ByteString

The file contents as a lazy ByteString.

-> wd Text 

Uploads a raw ByteString with associated file info. Returns the remote filepath of the file.

seleniumUploadZipEntry :: (HasCallStack, WebDriver wd) => Entry -> wd Text Source #

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

HTML5

deleteAllKeys :: (HasCallStack, WebDriver wd) => WebStorageType -> wd () Source #

Delete all keys within a given web storage area.

deleteKey :: (HasCallStack, WebDriver wd) => WebStorageType -> Text -> wd () Source #

Delete a key in the given web storage area.

getAllKeys :: (HasCallStack, WebDriver wd) => WebStorageType -> wd [Text] Source #

Get a list of all keys from a web storage area.

getKey :: (HasCallStack, WebDriver wd) => WebStorageType -> Text -> wd Text Source #

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.

setKey :: (HasCallStack, WebDriver wd) => WebStorageType -> Text -> Text -> wd Text Source #

Set a key in the given web storage area.

storageSize :: (HasCallStack, WebDriver wd) => WebStorageType -> wd Integer Source #

Get the current number of keys in a web storage area.

data ApplicationCacheStatus Source #

Instances

Instances details
FromJSON ApplicationCacheStatus Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

ToJSON ApplicationCacheStatus Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

Bounded ApplicationCacheStatus Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

Enum ApplicationCacheStatus Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

Read ApplicationCacheStatus Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

Show ApplicationCacheStatus Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

Eq ApplicationCacheStatus Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

Ord ApplicationCacheStatus Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

data WebStorageType Source #

An HTML 5 storage type

Instances

Instances details
Bounded WebStorageType Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

Enum WebStorageType Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

Show WebStorageType Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

Eq WebStorageType Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

Ord WebStorageType Source # 
Instance details

Defined in Test.WebDriver.Commands.SeleniumSpecific.HTML5

Misc

(</=>) :: (HasCallStack, WebDriver wd) => Element -> Element -> wd Bool infix 4 Source #

Determines if two element identifiers refer to different elements.

(<==>) :: (HasCallStack, WebDriver wd) => Element -> Element -> wd Bool infix 4 Source #

Determines if two element identifiers refer to the same element.

isDisplayed :: (HasCallStack, WebDriver wd) => Element -> wd Bool Source #

Determine if the element is displayed. This function isn't guaranteed to be implemented by the WebDriver spec, but it is found in Selenium. See https://www.w3.org/TR/webdriver1/#element-displayedness.

submit :: (HasCallStack, WebDriver wd) => Element -> wd () Source #

Submit a form element. This may be applied to descendents of a form element as well.