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

Method DeselectAll

dotnet/src/support/UI/SelectElement.cs:254–265  ·  view source on GitHub ↗

Clear all selected entries. This is only valid when the SELECT supports multiple selections. Thrown when attempting to deselect all options from a SELECT that does not support multiple selections.

()

Source from the content-addressed store, hash-verified

252 /// <exception cref="WebDriverException">Thrown when attempting to deselect all options from a SELECT
253 /// that does not support multiple selections.</exception>
254 public void DeselectAll()
255 {
256 if (!this.IsMultiple)
257 {
258 throw new InvalidOperationException("You may only deselect all options if multi-select is supported");
259 }
260
261 foreach (IWebElement option in this.Options)
262 {
263 SetSelected(option, false);
264 }
265 }
266
267 /// <summary>
268 /// Deselect the option by the text displayed.

Calls

no outgoing calls