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

Method deselect_all

py/selenium/webdriver/support/select.py:147–157  ·  view source on GitHub ↗

Clear all selected entries. This is only valid when the SELECT supports multiple selections. throws NotImplementedError If the SELECT does not support multiple selections

(self)

Source from the content-addressed store, hash-verified

145 raise NoSuchElementException(f"Could not locate element with visible text: {text}")
146
147 def deselect_all(self) -> None:
148 """Clear all selected entries.
149
150 This is only valid when the SELECT supports multiple selections.
151 throws NotImplementedError If the SELECT does not support
152 multiple selections
153 """
154 if not self.is_multiple:
155 raise NotImplementedError("You may only deselect all options of a multi-select")
156 for opt in self.options:
157 self._unset_selected(opt)
158
159 def deselect_by_value(self, value: str) -> None:
160 """Deselect all options that have a value matching the argument.

Calls 1

_unset_selectedMethod · 0.95