Safe Haskell | None |
---|
- newtype WD a = WD (StateT WDSession IO a)
- data WDSession = WDSession {
- wdHost :: String
- wdPort :: Word16
- wdBasePath :: String
- wdSessId :: Maybe SessionId
- lastHTTPRequest :: Maybe (Request ByteString)
- defaultSession :: WDSession
- newtype SessionId = SessionId Text
- data Capabilities = Capabilities {
- browser :: Browser
- version :: Maybe String
- platform :: Platform
- proxy :: ProxyType
- javascriptEnabled :: Maybe Bool
- takesScreenshot :: Maybe Bool
- handlesAlerts :: Maybe Bool
- databaseEnabled :: Maybe Bool
- locationContextEnabled :: Maybe Bool
- applicationCacheEnabled :: Maybe Bool
- browserConnectionEnabled :: Maybe Bool
- cssSelectorsEnabled :: Maybe Bool
- webStorageEnabled :: Maybe Bool
- rotatable :: Maybe Bool
- acceptSSLCerts :: Maybe Bool
- nativeEvents :: Maybe Bool
- unexpectedAlertBehavior :: Maybe UnexpectedAlertBehavior
- additionalCaps :: [Pair]
- defaultCaps :: Capabilities
- allCaps :: Capabilities
- data Platform
- data ProxyType
- = NoProxy
- | UseSystemSettings
- | AutoDetect
- | PAC { }
- | Manual { }
- data UnexpectedAlertBehavior
- data Browser
- = Firefox { }
- | Chrome { }
- | IE {
- ieIgnoreProtectedModeSettings :: Bool
- ieIgnoreZoomSetting :: Bool
- ieInitialBrowserUrl :: Maybe Text
- ieElementScrollBehavior :: IEElementScrollBehavior
- ieEnablePersistentHover :: Bool
- ieEnableElementCacheCleanup :: Bool
- ieRequireWindowFocus :: Bool
- ieBrowserAttachTimeout :: Integer
- ieLogFile :: Maybe FilePath
- ieLogLevel :: IELogLevel
- ieHost :: Maybe Text
- ieExtractPath :: Maybe Text
- ieSilent :: Bool
- ieForceCreateProcess :: Bool
- ieSwitches :: Maybe Text
- | Opera {
- operaBinary :: Maybe FilePath
- operaProduct :: Maybe String
- operaDetach :: Bool
- operaAutoStart :: Bool
- operaIdle :: Bool
- operaDisplay :: Maybe Int
- operaLauncher :: Maybe FilePath
- operaPort :: Maybe Word16
- operaHost :: Maybe String
- operaOptions :: Maybe String
- operaLogFile :: Maybe FilePath
- operaLogPref :: LogLevel
- | HTMLUnit
- | IPhone
- | IPad
- | Android
- | Browser Text
- firefox :: Browser
- chrome :: Browser
- ie :: Browser
- opera :: Browser
- iPhone :: Browser
- iPad :: Browser
- android :: Browser
- data LogLevel
- data IELogLevel
- = IELogTrace
- | IELogDebug
- | IELogInfo
- | IELogWarn
- | IELogError
- | IELogFatal
- data IEElementScrollBehavior
- = AlignTop
- | AlignBottom
- newtype Element = Element Text
- newtype WindowHandle = WindowHandle Text
- currentWindow :: WindowHandle
- data Selector
- data JSArg = forall a . ToJSON a => JSArg a
- data FrameSelector
- data Cookie = Cookie {}
- mkCookie :: Text -> Text -> Cookie
- data Orientation
- data MouseButton
- data WebStorageType
- type LogType = String
- data LogEntry = LogEntry {}
- data ApplicationCacheStatus
- = Uncached
- | Idle
- | Checking
- | Downloading
- | UpdateReady
- | Obsolete
- newtype InvalidURL = InvalidURL String
- newtype NoSessionId = NoSessionId String
- newtype BadJSON = BadJSON String
- data HTTPStatusUnknown = HTTPStatusUnknown (Int, Int, Int) String
- newtype HTTPConnError = HTTPConnError ConnError
- newtype UnknownCommand = UnknownCommand String
- newtype ServerError = ServerError String
- data FailedCommand = FailedCommand FailedCommandType FailedCommandInfo
- data FailedCommandType
- = NoSuchElement
- | NoSuchFrame
- | UnknownFrame
- | StaleElementReference
- | ElementNotVisible
- | InvalidElementState
- | UnknownError
- | ElementIsNotSelectable
- | JavascriptError
- | XPathLookupError
- | Timeout
- | NoSuchWindow
- | InvalidCookieDomain
- | UnableToSetCookie
- | UnexpectedAlertOpen
- | NoAlertOpen
- | ScriptTimeout
- | InvalidElementCoordinates
- | IMENotAvailable
- | IMEEngineActivationFailed
- | InvalidSelector
- | SessionNotCreated
- | MoveTargetOutOfBounds
- | InvalidXPathSelector
- | InvalidXPathSelectorReturnType
- | MethodNotAllowed
- data FailedCommandInfo = FailedCommandInfo {}
- data StackFrame = StackFrame {}
- mkFailedCommandInfo :: SessionState s => String -> s FailedCommandInfo
- failedCommand :: SessionState s => FailedCommandType -> String -> s a
WebDriver sessions
A monadic interface to the WebDriver server. This monad is simply a
state monad transformer over IO
, threading session information between sequential webdriver commands
Information about a WebDriver session. This structure is passed
implicitly through all WD
computations, and is also used to configure the WD
monad before execution.
WDSession | |
|
defaultSession :: WDSessionSource
A default session connects to localhost on port 4444, and hasn't been
initialized server-side. This value is the same as def
but with a less
polymorphic type.
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.
Capabilities and configuration
data Capabilities Source
A structure describing the capabilities of a session. This record serves dual roles.
- It's used to specify the desired capabilities for a session before it's created. In this usage, fields that are set to Nothing indicate that we have no preference for that capability.
- When received from the server , it's used to describe the actual capabilities given to us by the WebDriver server. Here a value of Nothing indicates that the server doesn't support the capability. Thus, for Maybe Bool fields, both Nothing and Just False indicate a lack of support for the desired capability.
Capabilities | |
|
Same as defaultCaps
, but with all Maybe
Bool
capabilities set to
Just
True
.
Represents platform options supported by WebDriver. The value Any represents no preference.
Available settings for the proxy Capabilities
field
NoProxy | |
UseSystemSettings | |
AutoDetect | |
PAC | Use a proxy auto-config file specified by URL |
Manual | Manually specify proxy hosts as hostname:port strings. Note that behavior is undefined for empty strings. |
Browser-specific configuration
This constructor simultaneously specifies which browser the session will
use, while also providing browser-specific configuration. Default
configuration is provided for each browser by firefox
, chrome
, opera
,
ie
, etc.
This library uses firefox
as its Default
browser configuration, when no
browser choice is specified.
Firefox | |
| |
Chrome | |
| |
IE | |
| |
Opera | |
| |
HTMLUnit | |
IPhone | |
IPad | |
Android | |
Browser Text | some other browser, specified by a string name |
Default settings for browsers
Default Firefox settings. All Maybe fields are set to Nothing. ffLogPref
is set to LogInfo
.
Default Chrome settings. All Maybe fields are set to Nothing, no options are specified, and no extensions are used.
Default IE settings. See the IE
constructor for more details on
individual defaults
Default Opera settings. See the Opera
constructor for more details on
individual defaults.
data IELogLevel Source
Logging levels for Internet Explorer
data IEElementScrollBehavior Source
Specifies how elements scroll into the viewport. (see ieElementScrollBehavior
)
WebDriver objects and command-specific types
An opaque identifier for a web page element.
newtype WindowHandle Source
An opaque identifier for a browser window
currentWindow :: WindowHandleSource
A special WindowHandle
that always refers to the currently focused window.
This is also used by the Default
instance.
Specifies element(s) within a DOM tree using various selection methods.
An existential wrapper for any ToJSON
instance. This allows us to pass
parameters of many different types to Javascript code.
data FrameSelector Source
Specifies the frame used by focusFrame
WithIndex Integer | |
WithName Text | focus on a frame by name or ID |
WithElement Element | focus on a frame |
DefaultFrame | focus on the first frame, or the main document if iframes are used. |
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.
Cookie | |
|
mkCookie :: Text -> Text -> CookieSource
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.
data Orientation Source
A screen orientation
data MouseButton Source
A mouse button
data WebStorageType Source
An HTML 5 storage type
A record that represents a single log entry.
Exceptions
newtype InvalidURL Source
An invalid URL was given
newtype NoSessionId Source
A command requiring a session ID was attempted when no session ID was available.
An error occured when parsing a JSON value.
data HTTPStatusUnknown Source
An unexpected HTTP status was sent by the server.
HTTPStatusUnknown (Int, Int, Int) String |
newtype HTTPConnError Source
HTTP connection errors.
newtype UnknownCommand Source
A command was sent to the WebDriver server that it didn't recognize.
newtype ServerError Source
A server-side exception occured
data FailedCommand Source
This exception encapsulates a broad variety of exceptions that can occur when a command fails.
data FailedCommandType Source
The type of failed command exception that occured.
data FailedCommandInfo Source
Detailed information about the failed command provided by the server.
FailedCommandInfo | |
|
Show FailedCommandInfo | Provides a readable printout of the error information, useful for logging. |
FromJSON FailedCommandInfo |
data StackFrame Source
An individual stack frame from the stack trace provided by the server during a FailedCommand.
StackFrame | |
|
mkFailedCommandInfo :: SessionState s => String -> s FailedCommandInfoSource
Constructs a FailedCommandInfo from only an error message.
failedCommand :: SessionState s => FailedCommandType -> String -> s aSource
Convenience function to throw a FailedCommand
locally with no server-side
info present.