Skip to content

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

ParameterTypeDescription
liststring(optional) the group containing the checkbox - by visible text or by name attribute
optionstringthe checkbox to uncheck

Example

Uncheck a checkbox

Here's a checkbox for illustration:

	
Choose ice cream flavor(s)

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:

	
Choose ice cream flavor(s)


Choose topping(s)

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")