Mahbub Rahman Mahbub Rahman - 2 months ago 16
Groovy Question

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
}

Answer

Have you tried:

checkboxes*.value(false)

I believe that should uncheck them all...

Comments