Skip to content

Instantly share code, notes, and snippets.

@denisshevchenko
Last active November 4, 2015 14:08
Show Gist options
  • Save denisshevchenko/92b945e39681bdaeb107 to your computer and use it in GitHub Desktop.
Save denisshevchenko/92b945e39681bdaeb107 to your computer and use it in GitHub Desktop.
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Test.WebDriver
firefoxConfig :: WDConfig
firefoxConfig = defaultConfig
main :: IO ()
main = do
runSession firefoxConfig $ do
openPage "http://www.zalora.sg/"
searchInput <- findElem $ ById "search-input"
sendKeys "Mens Faux Leather Strap Watch" searchInput
submit searchInput
firstOfWatches <- findElem $ ByClass "b-catalogList__itmLink"
click firstOfWatches
addToCartButton <- findElem $ ById "AddToCart"
click addToCartButton
putStrLn "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment