Last active
November 4, 2015 14:08
-
-
Save denisshevchenko/92b945e39681bdaeb107 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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