1

如何在具有选项组的选择列表中选择选项或设置值?

此方法不起作用:How to change a dropdown in an F# Canopy UI Testing Script

示例代码:

<!DOCTYPE html>
<html>
<body>

<select id="test-select">
  <optgroup label="Swedish Cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
  </optgroup>
  <optgroup label="German Cars">
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
  </optgroup>
</select>

</body>
</html>

冠层测试:

open canopy
open runner
open Helpers

    let all() =
    context "OptGroup Tests"

    let page = ""

    ntest ("Testing page " + page) (fun _ ->
        let mUrl = testpage.html
        url mUrl

        "#test-select" << "Audi"
    )
4

0 回答 0