Get Selected Option Index

Last modified: June 18, 2025

Description

Returns the index of the currently selected item of a WebElement, for example, select

Usage

Pass the parent WebElement of which you want to get the currently selected option's index from.

Input Parameters

NameDatatypeRequiredDescription
Select ElementWebElementyesThe parent WebElement, for example, select

Return Value

NameDatatypeDescription
Selected Option IndexIntegerThe index of the currently selected WebElement