Appearance
I.deselect()
Unchecks a checkbox.
This command ensures that a checkbox is unchecked. If the checkbox is already unchecked, this does nothing.
Usage
javascript
I.deselect(option: string)
I.deselect(list: string, option: string)Parameters
| Parameter | Type | Description |
|---|---|---|
list | string | (optional) the group containing the checkbox - by visible text or by name attribute |
option | string | the checkbox to uncheck |
Example
Uncheck a checkbox
Here's a checkbox for illustration:
Demo
UI
HTML
Uncheck the checkbox using text, option value, CSS or XPath selector:
js
// using text
I.deselect("Chocolate")
// using option value
I.deselect("flavor2")
// using CSS
I.deselect("input[value='flavor2']")
// using XPath
I.deselect("//label[contains(., 'Chocolate')]/input")Uncheck a checkbox in a group
Here's two similar group of checkboxes for illustration:
Demo
UI
HTML
Uncheck the checkbox in a specific group:
js
// specify group using text
I.deselect("Choose topping(s)", "Chocolate")
// specify group using `name` attribute
I.deselect("toppings", "Chocolate")