Module
Selenium
- Package
- purescript-webdriver
- Repository
- slamdata/purescript-webdriver
#affLocator Source
affLocator :: (Element -> Aff Element) -> Aff Locator
Build locator from asynchronous function returning element.
I.e. this locator will find first visible element with .common-element
class
affLocator \el → do
commonElements ← byCss ".common-element" >>= findElements el
flagedElements ← traverse (\el → Tuple el <$> isVisible el) commonElements
maybe err pure $ foldl foldFn Nothing flagedElements
where
err = throwError $ error "all common elements are not visible"
foldFn Nothing (Tuple el true) = Just el
foldFn a _ = a
#loseElement Source
loseElement :: Driver -> Locator -> Aff Unit
Tries to find element and throws an error if it succeeds.
#findElements Source
findElements :: forall f. Unfoldable f => Driver -> Locator -> Aff (f Element)
Finds elements by locator from document
#findChildren Source
findChildren :: forall f. Unfoldable f => Element -> Locator -> Aff (f Element)
Same a findElements
but starts searching from custom element
#showLocator Source
showLocator :: Locator -> String
#executeStr Source
executeStr :: Driver -> String -> Aff Foreign
Executes javascript script from String
argument.
#setFileDetector Source
setFileDetector :: Driver -> FileDetector -> Aff Unit
#getWindowHandle Source
getWindowHandle :: Driver -> Aff WindowHandle
#getAllWindowHandles Source
getAllWindowHandles :: forall f. Unfoldable f => Driver -> Aff (f WindowHandle)