Safe Haskell | None |
---|---|
Language | Haskell2010 |
- openPageSync :: (MonadIO wd, WebDriver wd) => String -> wd ()
- clickSync :: (MonadIO wd, WebDriver wd) => Element -> wd ()
- waitForPageLoad :: forall wd a. (MonadIO wd, WebDriver wd) => wd a -> wd a
- waitForElementToGoStale :: forall wd. (MonadIO wd, WebDriver wd) => Int -> Double -> Element -> wd ()
- ackStaleException :: forall wd. (MonadIO wd, MonadBase IO wd, WebDriver wd) => FailedCommand -> wd (Either () ST)
Documentation
openPageSync :: (MonadIO wd, WebDriver wd) => String -> wd ()
Use this instead of openPage
in order to avoid race conditions. Uses waitForPageLoad
.
clickSync :: (MonadIO wd, WebDriver wd) => Element -> wd ()
Like openPageSync
for click
.
waitForPageLoad :: forall wd a. (MonadIO wd, WebDriver wd) => wd a -> wd a
If you have an action act
that you know will load a new page, and you want this page to be
loaded and ready before the action returns, call waitForPageLoad act
instead. See also:
- http://www.obeythetestinggoat.com/how-to-get-selenium-to-wait-for-page-load-after-a-click.html
- https://github.com/kallisti-dev/hs-webdriver/issues/72
FIXME: There are horrible things going on in here like seemingly arbitrary calls to threadDelay, and timeout values that may be exceeded by a lot in practice. Using webdriver is not for the impatient.
waitForElementToGoStale :: forall wd. (MonadIO wd, WebDriver wd) => Int -> Double -> Element -> wd ()
We can't use waitWhile'
for this because that does not catch FailedCommand
StaleElementReference _
.
ackStaleException :: forall wd. (MonadIO wd, MonadBase IO wd, WebDriver wd) => FailedCommand -> wd (Either () ST)
Return Left ()
iff exception is StaleElementReference
. Re-throw all other exceptions.