79626658

Date: 2025-05-17 14:45:48
Score: 1
Natty:
Report link

A select element is as follows:

<select id="cars">
  <option value="ford">Ford</option>
  <option value="bmw">BMW</option>
</select>

You have an input type="radio" - a different type of HTML element, so I think what you may need to do is to select the element and send a click() to it, as per something like:

  string Xpath = ".//input[preceding-sibling::span[contains(.,'Admin')]]";
  var radio = driver.FindElement(By.Xpath(Xpath));
  radio.Click();

As per this answer here: https://stackoverflow.com/a/38908430/30012070

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Nick Pattman