MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / first_selected_option

Method first_selected_option

py/selenium/webdriver/support/select.py:55–60  ·  view source on GitHub ↗

Return the first selected option or the currently selected option.

(self)

Source from the content-addressed store, hash-verified

53
54 @property
55 def first_selected_option(self) -> WebElement:
56 """Return the first selected option or the currently selected option."""
57 for opt in self.options:
58 if opt.is_selected():
59 return opt
60 raise NoSuchElementException("No options are selected")
61
62 def select_by_value(self, value: str) -> None:
63 """Select all options that have a value matching the argument.

Callers

nothing calls this directly

Calls 2

is_selectedMethod · 0.80

Tested by

no test coverage detected