{-# LANGUAGE OverloadedStrings #-}
module Main where
import Web.Api.WebDriver.Endpoints
import Web.Api.WebDriver
main :: IO ()
main = do
x <- execWebDriverT defaultWebDriverConfig doLogin
print x
doLogin :: WebDriverT IO ()
doLogin = do
fullscreenWindow
navigateTo "http://localhost:8001/login"
z <- findElements CssSelector "div.alert"
assertEqual [] z "Errors found"
上面的代码导致错误:
2021-12-13 16:32:39 错误错误没有正在进行的会话(左(E NoSession),S {_httpOptions = Options { manager = Left _,proxy = Nothing,auth = Nothing,headers = [("User-Agent ","haskell wreq-0.5.3.2")], params = [], redirects = 10, cookies = Just (CJ {expose = []}) }, _httpSession = Nothing, _userState = WDState {_sessionId = Nothing, _breakpoints = BreakpointsOff}},W {unW = [LogEntry {_logEntryTimestamp = 2021-12-13 16:32:39.03282154 UTC, _logEntryUID = "", _logEntrySeverity = LogError, _logEntry = L_Error NoSession}]})
这个错误说明了什么?我错过了什么?
完整的示例项目可以在这里找到:https ://github.com/chrissound/434/commit/ea1f3d840b64093b40ebba0e3dfceaacd4b36716