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

Safe HaskellNone
LanguageHaskell98

Test.WebDriver.Monad

Synopsis

Documentation

newtype WD a Source

A monadic interface to the WebDriver server. This monad is simply a state monad transformer over IO, threading session information between sequential webdriver commands

Constructors

WD (StateT WDSession IO a) 

runWD :: WDSession -> WD a -> IO a Source

Executes a WD computation within the IO monad, using the given WDSession.

runSession :: WDConfig -> WD a -> IO a Source

Executes a WD computation within the IO monad, automatically creating a new session beforehand.

NOTE: session is not automatically closed when complete. If you want this behavior, use finallyClose. Example: > runSessionThenClose action = runSession myConfig . finallyClose $ action

withSession :: WDSession -> WD a -> WD a Source

Locally sets a WDSession for use within the given WD action. The state of the outer action is unaffected by this function. This function is useful if you need to work with multiple sessions at once.

finallyClose :: WebDriver wd => wd a -> wd a Source

A finalizer ensuring that the session is always closed at the end of the given WD action, regardless of any exceptions.

closeOnException :: WebDriver wd => wd a -> wd a Source

Exception handler that closes the session when an asynchronous exception is thrown, but otherwise leaves the session open if the action was successful.

dumpSessionHistory :: (MonadIO wd, WebDriver wd) => wd a -> wd a Source

Prints a history of API requests to stdout after computing the given action.