title: Find out which radio button is selected using Selenium (implemented as li)
body: <p>I have the below HTML. It's a small window with 3 radio buttons. Its implemented as a ul with 3 li elements. Below code clicks on the div inside the li and is selecting the radio button:</p>
  
  <pre><code>WebElement v = driver.findElement(By.xpath("/html/body/div[4]/div/div[2]/div/div[1]/div[2]/ul/li[2]/div[1]"));
  JavascriptExecutor jsb = (JavascriptExecutor) driver;
  jsb.executeScript("arguments[0].click();", v);
  </code></pre>
  
  <p>How do I find out which of the three radio button is clicked? I want to open this screen again and be able to tell which one of the radio buttons is selected.</p>
  
  <p><a href="https://i.stack.imgur.com/Nve1h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Nve1h.png" alt="HTML[![][1]"></a>]<a href="https://i.stack.imgur.com/mcwtb.png" rel="nofollow noreferrer">2</a></p>