What is the Selection By Text in GUI ComboBox actions?

In GUI ComboBox actions, what is the difference between Select By Index, Select By Value, and Select By Visible Text?

In GUI automation, a ComboBox (dropdown list) allows users to select one option from multiple available options. Different actions are used to select an item based on how the option is identified.

1. Select By Index
This method selects an option based on its position in the dropdown list.
The index usually starts from 0, meaning the first item in the list has index 0.

Example:
If the dropdown contains:
0 – Select Country
1 – India
2 – USA

Using Select By Index = 1 will select India.

2. Select By Value
This method selects an option based on the value attribute associated with the option in the underlying element. The value may be different from the text displayed to the user.

Example:
If the option is defined as:
<option value="IN">India</option>

Using Select By Value = “IN” will select India.

3. Select By Visible Text
This method selects the option based on the text that is displayed to the user in the dropdown. It matches the exact visible label.

Example:
If the dropdown shows India, using Select By Visible Text = “India” will select that option.