SelectElementSelectByText Method WebDriver
Select all options by the text displayed.

Namespace: OpenQA.Selenium.Support.UI
Assembly: WebDriver.Support (in WebDriver.Support.dll) Version: 3.1.0
Syntax

public void SelectByText(
	string text
)

Parameters

text
Type: SystemString
The text of the option to be selected. If an exact match is not found, this method will perform a substring match.
Exceptions

ExceptionCondition
NoSuchElementExceptionThrown if there is no element with the given text present.
Remarks

When given "Bar" this method would select an option like:

<option value="foo">Bar</option>

See Also

Reference