Search code examples
checkboxgroovyspockgebnavigator

Spock: How to clear checkbox if already checked


How to uncheck a checkbox using Navigator object? I have

def checkboxes = $("input",class:"targetMltChk", name:"facility")

which is a group of checkboxes and some of them are checked. I want to uncheck all of them.

UPDATE: I tried the below:

checkboxes.each{
                println it = false
            }

Solution

  • Have you tried:

    checkboxes*.value(false)
    

    I believe that should uncheck them all...