title: How To Perform Multiple Radio Button Click in Selenium Webdriver
body: <p>How to make condition to perform multiple radio button click (see image below)...?</p>
  
  <p><a href="http://i.stack.imgur.com/dCaiK.jpg" rel="nofollow">multiple radio button click</a></p>
  
  <p>I've tried for hours, but I got only single radio button click (see attached image)</p>
  
  <p><a href="http://i.stack.imgur.com/LNOdV.jpg" rel="nofollow">single radio button click</a></p>
  
  <pre><code>List&lt;WebElement&gt; radiobutton = driver.findElements(By.xpath("//*[@type='radio']"));
      System.out.println("Total element is " + radiobutton.size());
  
      for (int i = 0; i &lt; radiobutton.size(); i++) {
  
          // if you are getting stale element exception because of the page
          // reload
          radiobutton = driver.findElements(By.xpath("//*[@type='radio']"));
  
          System.out.println(radiobutton.get(i).getAttribute("value"));
  
          // select your radio and click to go to next page
          radiobutton.get(i).click();
  
          Thread.sleep(3000);
  
          driver.findElement(By.xpath("//input[@id='btnCheckFare']"))
                  .click();
  
          Thread.sleep(3000);
      }
  </code></pre>