-- -- You'll need the HUnit library to run this. -- -- import Control.Monad.Error import Data.Maybe import Network.BSD import Network.URI import Test.Selenium.Server import Test.Selenium.Syntax import Test.Selenium.HUnit test1 :: Selenium () test1 = do open "/" typeText (Name "q") "foo" clickAndWait (Name "btnG") b <- isTextPresent "foo" unless b $ throwError "foo not present" -- Note: not using HUnit assertions return () main :: IO () main = do host <- getHostName let uri = fromMaybe nullURI (parseURI "http://www.google.com/") withSelenium (mkSeleniumRCSession host Firefox uri) $ do runSeleniumTestsTT [ ("Test 1", test1) ] return ()