F# Canopy Select or Dropdown with Option Group

500 Views Asked by At

How do you select an option or set the value in a select list that has option groups?

This method does not work: How to change a dropdown in an F# Canopy UI Testing Script

sample code:

<!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>

Canopy Test:

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

There are 0 best solutions below

Related Questions in F#