Select Checkboxes and Radio Buttons

I.select

Select a dropdown, checkbox, or radio button.

This -ONLY- works on native HTML5 elements.

For custom elements, use I.click as a fallback.\

Usage

Select an option:

I.select(option)

Select an option in a list:

I.select(list, option)

Parameters

ParameterTypeRemarks
liststring(Optional) Keyword to identify the options list
optionstringKeyword to identify the option to select

Example(s)

Select a dropdown

Here, we will use this "Number" dropdown list for illustration.

Number

One

Two

Three

Specify the option;

 I.select("Two");

Or, specify the list and the option:

I.select("Number", "Two");

This selects the option "Two".

Select a checkbox

Here, we will use this check box for illustration.

☐ I agree to the terms and conditions

I.select("I agree to the terms and conditions");

This selects the checkbox "I agree to the terms and conditions".

Select a check box in a checkbox list

Here, we will use this "Color" checkbox list for illustration.

Color ☐ Red ☐ Blue ☐ Green

Specify the option;

I.select("Red");

Or, specify the list and the option:

I.select("Color", "Red");

This selects the option "Red".

Select a radio button

Here, we will use this "Animal" radio button list for illustration.

Animal ○ Cat ○ Dog ○ Mouse

Specify the option;

I.select("Cat");

Or, specify the list and the option:

I.select("Animal", "Cat");

This selects the option "Cat".


I.selected

Asserts that a dropdown option, checkbox, or radio button is selected

Usage

I.selected(option)
I.selected(list, option)

Parameters

ParameterTypeRemarks
liststringKeyword to identify the options list
optionstringKeyword to identify the option to be selected

I.deselect

Deselect a checkbox.

Usage

Deselect an option:

I.deselect(option)

Deselect an option in a list:

I.deselect(list, option)

Parameters

ParameterTypeRemarks
list (optional)stringKeyword to identify the options list
optionstringKeyword to identify the option to deselect

I.deselected

Asserts that a dropdown option, checkbox, or radio button is NOT selected

Usage

I.deselected(option)
I.deselected(list, option)

Parameters

ParameterTypeRemarks
liststringKeyword to identify the options list
optionstringKeyword to identify the option that expected to be NOT selected

\

Last Updated: