Skip to main content

Set Web Checkbox

Command description

Set the state of an <input type="checkbox"> element through JavaScript. The command does not move the mouse and can operate an obscured element. For example:

<form action="/demo/action_page.php">
<input type="checkbox" id="vehicle1" name="vehicle1" value="Bike">
<label for="vehicle1"> I have a bicycle</label><br>
<input type="checkbox" id="vehicle2" name="vehicle2" value="Car">
<label for="vehicle2"> I have a car</label><br>
<input type="checkbox" id="vehicle3" name="vehicle3" value="Boat">
<label for="vehicle3"> I have a boat</label><br><br>
<input type="submit" value="Submit">
</form>

Command Input Parameters

input parametersInput parameter typeDescription
Webpage ObjectWebPageWebpage containing the checkbox
Web ElementWebElement or str (captured element UID, not element name, not ms-rpa-id)Select a captured element or one returned by Get Web Element, Get Similar Web Elements, or Get Related Web Elements
StatusenumSelect, Deselect, Toggle
Element Wait DurationnumberMaximum time to wait for the element to appear, in seconds. The command reports an error if the element does not appear in time
Post-Execution DelaynumberTime to wait after setting the checkbox, in seconds

Command Output Parameters

None

Type definition reference

tip

Example

FAQ

See Web Automation FAQ