SimpleTest Browser All Checkboxes Same Name

43 Views Asked by At

Using SimpleTest, how would I check the third checkbox if they all share the same name?

<input type='checkbox' class='style' name='same' value="First" />
<input type='checkbox' class='style' name='same' value="Second" />
<input type='checkbox' class='style' name='same' value="Third" />
<input type='checkbox' class='style' name='same' value="Forth" />

Alternatively, when I get() the URL using SimpleTest, can I somehow add ID's to the inputs?

1

There are 1 best solutions below

0
conal On

I have figured it out. This toggled the correct box..

$browser->setField("same", array("Third"));