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

Method SetSelected

dotnet/src/support/UI/SelectElement.cs:435–447  ·  view source on GitHub ↗
(IWebElement option, bool select)

Source from the content-addressed store, hash-verified

433 }
434
435 private static void SetSelected(IWebElement option, bool select)
436 {
437 if (select && !option.Enabled)
438 {
439 throw new InvalidOperationException("You may not select a disabled option");
440 }
441
442 bool isSelected = option.Selected;
443 if ((!isSelected && select) || (isSelected && !select))
444 {
445 option.Click();
446 }
447 }
448}

Callers

nothing calls this directly

Calls 1

ClickMethod · 0.45

Tested by

no test coverage detected