| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
WebDriverPreCore.Http
Description
Deprecated: WebDriverPreCore.Http - will be removed in a future release ~ 2027-02-01 (USE WebDriverPreCore.HTTP.Protocol instead). See ChangeLog.md for upgrade instructions
Synopsis
- data HttpSpec a
- = Get {
- description :: Text
- path :: UrlPath
- parser :: HttpResponse -> Result a
- | Post {
- description :: Text
- path :: UrlPath
- body :: Value
- parser :: HttpResponse -> Result a
- | PostEmpty {
- description :: Text
- path :: UrlPath
- parser :: HttpResponse -> Result a
- | Delete {
- description :: Text
- path :: UrlPath
- parser :: HttpResponse -> Result a
- = Get {
- newSession :: FullCapabilities -> HttpSpec SessionResponse
- status :: HttpSpec Status
- newSession' :: ToJSON a => a -> HttpSpec SessionResponse
- deleteSession :: Session -> HttpSpec ()
- getTimeouts :: Session -> HttpSpec Timeouts
- setTimeouts :: Session -> Timeouts -> HttpSpec ()
- navigateTo :: Session -> URL -> HttpSpec ()
- getCurrentUrl :: Session -> HttpSpec URL
- back :: Session -> HttpSpec ()
- forward :: Session -> HttpSpec ()
- refresh :: Session -> HttpSpec ()
- getTitle :: Session -> HttpSpec Text
- getWindowHandle :: Session -> HttpSpec Handle
- newWindow :: Session -> HttpSpec WindowHandleSpec
- closeWindow :: Session -> HttpSpec [Handle]
- switchToWindow :: Session -> Handle -> HttpSpec ()
- switchToFrame :: Session -> FrameReference -> HttpSpec ()
- getPageSource :: Session -> HttpSpec Text
- executeScript :: Session -> Script -> HttpSpec Value
- executeScriptAsync :: Session -> Script -> HttpSpec Value
- addCookie :: Session -> Cookie -> HttpSpec ()
- getAllCookies :: Session -> HttpSpec [Cookie]
- getNamedCookie :: Session -> Text -> HttpSpec Cookie
- deleteCookie :: Session -> Text -> HttpSpec ()
- deleteAllCookies :: Session -> HttpSpec ()
- performActions :: Session -> Actions -> HttpSpec ()
- releaseActions :: Session -> HttpSpec ()
- dismissAlert :: Session -> HttpSpec ()
- acceptAlert :: Session -> HttpSpec ()
- getAlertText :: Session -> HttpSpec Text
- sendAlertText :: Session -> Text -> HttpSpec ()
- takeScreenshot :: Session -> HttpSpec Text
- printPage :: Session -> HttpSpec Text
- getWindowHandles :: Session -> HttpSpec [Handle]
- getWindowRect :: Session -> HttpSpec WindowRect
- setWindowRect :: Session -> WindowRect -> HttpSpec WindowRect
- maximizeWindow :: Session -> HttpSpec WindowRect
- minimizeWindow :: Session -> HttpSpec WindowRect
- fullscreenWindow :: Session -> HttpSpec WindowRect
- newWindow :: Session -> HttpSpec WindowHandleSpec
- closeWindow :: Session -> HttpSpec [Handle]
- switchToWindow :: Session -> Handle -> HttpSpec ()
- getWindowHandles :: Session -> HttpSpec [Handle]
- getWindowRect :: Session -> HttpSpec WindowRect
- setWindowRect :: Session -> WindowRect -> HttpSpec WindowRect
- maximizeWindow :: Session -> HttpSpec WindowRect
- minimizeWindow :: Session -> HttpSpec WindowRect
- fullscreenWindow :: Session -> HttpSpec WindowRect
- switchToParentFrame :: Session -> HttpSpec ()
- getActiveElement :: Session -> HttpSpec ElementId
- findElement :: Session -> Selector -> HttpSpec ElementId
- findElements :: Session -> Selector -> HttpSpec [ElementId]
- findElementFromElement :: Session -> ElementId -> Selector -> HttpSpec ElementId
- findElementsFromElement :: Session -> ElementId -> Selector -> HttpSpec [ElementId]
- isElementSelected :: Session -> ElementId -> HttpSpec Bool
- getElementAttribute :: Session -> ElementId -> Text -> HttpSpec Text
- getElementProperty :: Session -> ElementId -> Text -> HttpSpec Value
- getElementCssValue :: Session -> ElementId -> Text -> HttpSpec Text
- getElementShadowRoot :: Session -> ElementId -> HttpSpec ShadowRootElementId
- getElementText :: Session -> ElementId -> HttpSpec Text
- getElementTagName :: Session -> ElementId -> HttpSpec Text
- getElementRect :: Session -> ElementId -> HttpSpec WindowRect
- isElementEnabled :: Session -> ElementId -> HttpSpec Bool
- getElementComputedRole :: Session -> ElementId -> HttpSpec Text
- getElementComputedLabel :: Session -> ElementId -> HttpSpec Text
- elementClick :: Session -> ElementId -> HttpSpec ()
- elementClear :: Session -> ElementId -> HttpSpec ()
- elementSendKeys :: Session -> ElementId -> Text -> HttpSpec ()
- takeElementScreenshot :: Session -> ElementId -> HttpSpec Text
- findElementFromShadowRoot :: Session -> ShadowRootElementId -> Selector -> HttpSpec ElementId
- findElementsFromShadowRoot :: Session -> ShadowRootElementId -> Selector -> HttpSpec [ElementId]
- module WebDriverPreCore.HTTP.HttpResponse
- data Capabilities = MkCapabilities {
- browserName :: Maybe BrowserName
- browserVersion :: Maybe Text
- platformName :: Maybe PlatformName
- acceptInsecureCerts :: Maybe Bool
- pageLoadStrategy :: Maybe PageLoadStrategy
- proxy :: Maybe Proxy
- setWindowRect :: Maybe Bool
- timeouts :: Maybe Timeouts
- strictFileInteractability :: Maybe Bool
- unhandledPromptBehavior :: Maybe UnhandledPromptBehavior
- webSocketUrl :: Maybe Bool
- vendorSpecific :: Maybe VendorSpecific
- data FullCapabilities = MkFullCapabilities {}
- data WebDriverException
- data ErrorType
- = ElementClickIntercepted
- | ElementNotInteractable
- | InsecureCertificate
- | InvalidArgument
- | InvalidCookieDomain
- | InvalidElementState
- | InvalidSelector
- | InvalidSessionId
- | JavascriptError
- | MoveTargetOutOfBounds
- | NoSuchAlert
- | NoSuchCookie
- | NoSuchElement
- | NoSuchFrame
- | NoSuchWindow
- | NoSuchShadowRoot
- | ScriptTimeout
- | SessionNotCreated
- | StaleElementReference
- | DetachedShadowRoot
- | Timeout
- | UnableToSetCookie
- | UnableToCaptureScreen
- | UnexpectedAlertOpen
- | UnknownCommand
- | UnknownError
- | UnknownMethod
- | UnsupportedOperation
- | InvalidWebExtension
- | NoSuchClientWindow
- | NoSuchHandle
- | NoSuchHistoryEntry
- | NoSuchNetworkCollector
- | NoSuchIntercept
- | NoSuchNetworkData
- | NoSuchNode
- | NoSuchRequest
- | NoSuchScript
- | NoSuchStoragePartition
- | NoSuchUserContext
- | NoSuchWebExtension
- | UnableToCloseBrowser
- | UnableToSetFileInput
- | UnavailableNetworkData
- | UnderspecifiedStoragePartition
- data JSONEncodeException = MkJSONEncodeException {
- message :: Text
- responseText :: Text
- errorDescription :: ErrorType -> Text
- toErrorType :: Text -> Either Text ErrorType
- toErrorCode :: ErrorType -> Text
- parseWebDriverException :: Text -> Value -> WebDriverException
- parseErrorType :: Value -> Maybe ErrorType
The HttpSpec Type
The HttpSpec type is a specification for a WebDriver Http command.
Every endpoint function in this module returns a HttpSpec object.
Constructors
| Get | |
Fields
| |
| Post | |
Fields
| |
| PostEmpty | |
Fields
| |
| Delete | |
Fields
| |
Root Methods
newSession :: FullCapabilities -> HttpSpec SessionResponse Source #
Return a spec to create a new session given FullCapabilities object.
newSession' can be used if FullCapabilities doesn't meet your requirements.
POST /session New Session
newSession' :: ToJSON a => a -> HttpSpec SessionResponse Source #
Return a spec to create a new session given an object of any type that implements ToJSON.
The FullCapabilities type and associated types should work for the vast majority use cases, but if the required capabilities are not covered by the types provided, newSession'.
can be used with a custom type instead. newSession' works with any type that implements ToJSON, (including an Aeson Value).
Obviously, any type used must produce a JSON object compatible with capabilities as defined W3C spec.
POST /session New Session
Session Methods
See also newSession and newSession'
deleteSession :: Session -> HttpSpec () Source #
switchToFrame :: Session -> FrameReference -> HttpSpec () Source #
Return a spec to switch to a different frame given a Session and FrameReference.
POST /session/{session id}/frame Switch To FramedeleteAllCookies :: Session -> HttpSpec () Source #
releaseActions :: Session -> HttpSpec () Source #
dismissAlert :: Session -> HttpSpec () Source #
acceptAlert :: Session -> HttpSpec () Source #
setWindowRect :: Session -> WindowRect -> HttpSpec WindowRect Source #
Return a spec to set the window rect of the current window given a Session and WindowRect.
POST /session/{session id}/window/rect Set Window RectWindow Methods
setWindowRect :: Session -> WindowRect -> HttpSpec WindowRect Source #
Return a spec to set the window rect of the current window given a Session and WindowRect.
POST /session/{session id}/window/rect Set Window RectFrame Methods
switchToParentFrame :: Session -> HttpSpec () Source #
Element(s) Methods
Element Instance Methods
getElementRect :: Session -> ElementId -> HttpSpec WindowRect Source #
Shadow DOM Methods
findElementFromShadowRoot :: Session -> ShadowRootElementId -> Selector -> HttpSpec ElementId Source #
findElementsFromShadowRoot :: Session -> ShadowRootElementId -> Selector -> HttpSpec [ElementId] Source #
HTTP Response
Capabilities
data Capabilities Source #
Capabilities define the properties of the session and are passed to the webdriver
via fields of the FullCapabilities object.
See also: FullCapabilities and related constructors such as: minCapabilities,
minFullCapabilities, minFirefoxCapabilities and minChromeCapabilities
Constructors
Instances
data FullCapabilities Source #
FullCapabilities is the object that is passed to webdriver to define the properties of the session via the newSession function.
It is a combination of alwaysMatch and firstMatch properties.
See also: Capabilities and related constructors such as minCapabilities, minFullCapabilities, minFirefoxCapabilities and minChromeCapabilities
Constructors
| MkFullCapabilities | |
Fields
| |
Instances
| FromJSON FullCapabilities Source # | |||||
Defined in WebDriverPreCore.HTTP.Capabilities Methods parseJSON :: Value -> Parser FullCapabilities # parseJSONList :: Value -> Parser [FullCapabilities] # | |||||
| ToJSON FullCapabilities Source # | |||||
Defined in WebDriverPreCore.HTTP.Capabilities Methods toJSON :: FullCapabilities -> Value # toEncoding :: FullCapabilities -> Encoding # toJSONList :: [FullCapabilities] -> Value # toEncodingList :: [FullCapabilities] -> Encoding # omitField :: FullCapabilities -> Bool # | |||||
| Generic FullCapabilities Source # | |||||
Defined in WebDriverPreCore.HTTP.Capabilities Associated Types
Methods from :: FullCapabilities -> Rep FullCapabilities x # to :: Rep FullCapabilities x -> FullCapabilities # | |||||
| Show FullCapabilities Source # | |||||
Defined in WebDriverPreCore.HTTP.Capabilities Methods showsPrec :: Int -> FullCapabilities -> ShowS # show :: FullCapabilities -> String # showList :: [FullCapabilities] -> ShowS # | |||||
| type Rep FullCapabilities Source # | |||||
Defined in WebDriverPreCore.HTTP.Capabilities type Rep FullCapabilities = D1 ('MetaData "FullCapabilities" "WebDriverPreCore.HTTP.Capabilities" "webdriver-precore-0.2.0.0-inplace" 'False) (C1 ('MetaCons "MkFullCapabilities" 'PrefixI 'True) (S1 ('MetaSel ('Just "alwaysMatch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Capabilities)) :*: S1 ('MetaSel ('Just "firstMatch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Capabilities]))) | |||||
Errors
data WebDriverException Source #
Constructors
| ResponseParseException | |
| UnrecognisedErrorTypeException | |
| JSONEncodeException JSONEncodeException | |
| ProtocolException | |
Instances
| Exception WebDriverException Source # | |||||
Defined in WebDriverPreCore.Error Methods toException :: WebDriverException -> SomeException # fromException :: SomeException -> Maybe WebDriverException # | |||||
| Generic WebDriverException Source # | |||||
Defined in WebDriverPreCore.Error Associated Types
Methods from :: WebDriverException -> Rep WebDriverException x # to :: Rep WebDriverException x -> WebDriverException # | |||||
| Show WebDriverException Source # | |||||
Defined in WebDriverPreCore.Error Methods showsPrec :: Int -> WebDriverException -> ShowS # show :: WebDriverException -> String # showList :: [WebDriverException] -> ShowS # | |||||
| Eq WebDriverException Source # | |||||
Defined in WebDriverPreCore.Error Methods (==) :: WebDriverException -> WebDriverException -> Bool # (/=) :: WebDriverException -> WebDriverException -> Bool # | |||||
| Ord WebDriverException Source # | |||||
Defined in WebDriverPreCore.Error Methods compare :: WebDriverException -> WebDriverException -> Ordering # (<) :: WebDriverException -> WebDriverException -> Bool # (<=) :: WebDriverException -> WebDriverException -> Bool # (>) :: WebDriverException -> WebDriverException -> Bool # (>=) :: WebDriverException -> WebDriverException -> Bool # max :: WebDriverException -> WebDriverException -> WebDriverException # min :: WebDriverException -> WebDriverException -> WebDriverException # | |||||
| type Rep WebDriverException Source # | |||||
Defined in WebDriverPreCore.Error type Rep WebDriverException = D1 ('MetaData "WebDriverException" "WebDriverPreCore.Error" "webdriver-precore-0.2.0.0-inplace" 'False) ((C1 ('MetaCons "ResponseParseException" 'PrefixI 'True) (S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "response") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Value)) :+: C1 ('MetaCons "UnrecognisedErrorTypeException" 'PrefixI 'True) (S1 ('MetaSel ('Just "errorType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "response") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Value))) :+: (C1 ('MetaCons "JSONEncodeException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 JSONEncodeException)) :+: C1 ('MetaCons "ProtocolException" 'PrefixI 'True) ((S1 ('MetaSel ('Just "error") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ErrorType) :*: (S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))) :*: (S1 ('MetaSel ('Just "stacktrace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "errorData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Value)) :*: S1 ('MetaSel ('Just "response") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Value)))))) | |||||
Known WevDriver Error Types
Constructors
| ElementClickIntercepted | |
| ElementNotInteractable | |
| InsecureCertificate | |
| InvalidArgument | |
| InvalidCookieDomain | |
| InvalidElementState | |
| InvalidSelector | |
| InvalidSessionId | |
| JavascriptError | |
| MoveTargetOutOfBounds | |
| NoSuchAlert | |
| NoSuchCookie | |
| NoSuchElement | |
| NoSuchFrame | |
| NoSuchWindow | |
| NoSuchShadowRoot | |
| ScriptTimeout | |
| SessionNotCreated | |
| StaleElementReference | |
| DetachedShadowRoot | |
| Timeout | |
| UnableToSetCookie | |
| UnableToCaptureScreen | |
| UnexpectedAlertOpen | |
| UnknownCommand | |
| UnknownError | |
| UnknownMethod | |
| UnsupportedOperation | |
| InvalidWebExtension | |
| NoSuchClientWindow | |
| NoSuchHandle | |
| NoSuchHistoryEntry | |
| NoSuchNetworkCollector | |
| NoSuchIntercept | |
| NoSuchNetworkData | |
| NoSuchNode | |
| NoSuchRequest | |
| NoSuchScript | |
| NoSuchStoragePartition | |
| NoSuchUserContext | |
| NoSuchWebExtension | |
| UnableToCloseBrowser | |
| UnableToSetFileInput | |
| UnavailableNetworkData | |
| UnderspecifiedStoragePartition |
Instances
| FromJSON ErrorType Source # | |
Defined in WebDriverPreCore.Error | |
| Bounded ErrorType Source # | |
| Enum ErrorType Source # | |
Defined in WebDriverPreCore.Error Methods succ :: ErrorType -> ErrorType # pred :: ErrorType -> ErrorType # fromEnum :: ErrorType -> Int # enumFrom :: ErrorType -> [ErrorType] # enumFromThen :: ErrorType -> ErrorType -> [ErrorType] # enumFromTo :: ErrorType -> ErrorType -> [ErrorType] # enumFromThenTo :: ErrorType -> ErrorType -> ErrorType -> [ErrorType] # | |
| Read ErrorType Source # | |
| Show ErrorType Source # | |
| Eq ErrorType Source # | |
| Ord ErrorType Source # | |
data JSONEncodeException Source #
Constructors
| MkJSONEncodeException | |
Fields
| |
Instances
| FromJSON JSONEncodeException Source # | |||||
Defined in WebDriverPreCore.Error Methods parseJSON :: Value -> Parser JSONEncodeException # parseJSONList :: Value -> Parser [JSONEncodeException] # | |||||
| Generic JSONEncodeException Source # | |||||
Defined in WebDriverPreCore.Error Associated Types
Methods from :: JSONEncodeException -> Rep JSONEncodeException x # to :: Rep JSONEncodeException x -> JSONEncodeException # | |||||
| Show JSONEncodeException Source # | |||||
Defined in WebDriverPreCore.Error Methods showsPrec :: Int -> JSONEncodeException -> ShowS # show :: JSONEncodeException -> String # showList :: [JSONEncodeException] -> ShowS # | |||||
| Eq JSONEncodeException Source # | |||||
Defined in WebDriverPreCore.Error Methods (==) :: JSONEncodeException -> JSONEncodeException -> Bool # (/=) :: JSONEncodeException -> JSONEncodeException -> Bool # | |||||
| Ord JSONEncodeException Source # | |||||
Defined in WebDriverPreCore.Error Methods compare :: JSONEncodeException -> JSONEncodeException -> Ordering # (<) :: JSONEncodeException -> JSONEncodeException -> Bool # (<=) :: JSONEncodeException -> JSONEncodeException -> Bool # (>) :: JSONEncodeException -> JSONEncodeException -> Bool # (>=) :: JSONEncodeException -> JSONEncodeException -> Bool # max :: JSONEncodeException -> JSONEncodeException -> JSONEncodeException # min :: JSONEncodeException -> JSONEncodeException -> JSONEncodeException # | |||||
| type Rep JSONEncodeException Source # | |||||
Defined in WebDriverPreCore.Error type Rep JSONEncodeException = D1 ('MetaData "JSONEncodeException" "WebDriverPreCore.Error" "webdriver-precore-0.2.0.0-inplace" 'False) (C1 ('MetaCons "MkJSONEncodeException" 'PrefixI 'True) (S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "responseText") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))) | |||||
errorDescription :: ErrorType -> Text Source #
toErrorCode :: ErrorType -> Text Source #