webdriver- a Haskell client for the Selenium WebDriver protocol

Safe HaskellNone




newtype WD a Source

A monadic interface to the WebDriver server. This monad is a simple, strict layer over IO, threading session information between sequential commands


WD (StateT WDSession IO a) 

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

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

runSession :: WDSession -> Capabilities -> WD a -> IO aSource

Like runWD, but automatically creates a session beforehand and closes it afterwards. This is a very common use case.

withSession :: WDSession -> WD a -> WD aSource

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 :: WD a -> WD aSource

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

closeOnException :: WD a -> WD aSource

A variant of finallyClose that only closes the session when an asynchronous exception is thrown, but otherwise leaves the session open if the action was successful.