F#选择或下拉选项组

时间:2016-03-04 14:35:53

标签: f# web-testing canopy-web-testing

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

此方法不起作用: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"
    )

0 个答案:

没有答案