虽然这个命令成功了

".navbar-brand" == "AUP"

谁能告诉我为什么这一行:

(element ".navbar-brand") == "AUP"

导致此错误?

错误:无法检查OpenQA.Selenium.Remote.RemoteWebElement上的相等性,因为它不是字符串或警报Url:http://myurl.com Stack:at canopy.core.op_EqualsEquals [a](项目,字符串值)在C:\ projects \ canopy \ src \ canopy \ canopy.fs:第437行,位于C:\ Users \ jj06848 \ Projects \ AUPE2ETest \ AUPE2ETest \ CanopyTest \ Program.fs中的Program.clo@24.Invoke(Unit _arg1) :位于C:\ projects \ canopy \ src \ canopy \ runner.fs:第102行的canopy.runner.runtest$cont@93(套件套件,测试测试,Unit unitVar)第28行

根据文件,这两者都应该是成功的 . 我在我的测试中有几个其他地方,我试图将IWebElement传递给断言,但似乎都有相同的错误 . 例如:

let bidHistoryResults = (elements ".table-striped")
let bidHistoryRows = bidHistoryResults.[2] |> elementsWithin "tr"
let firstRow = bidHistoryRows.[1] |> elementsWithin "td"
let secondRow = bidHistoryRows.[2] |> elementsWithin "td"
firstRow.[6] == "$15.93"

我是F#和Canopy的新手,希望有人可以给我一个正确的方向 .

谢谢