Skip to main content
2 of 4
edited tags
Rutvi Soni
  • 536
  • 1
  • 11
  • 27

Display error while select radio button in selenium

i am making testcases for the 7 radiobutton but display run time error while selection of the radio button. public void selecttemplate() {

    List<WebElement> rdBtn = driver.findElements(By.name("Template_Type"));
            
    int size=rdBtn.size();
    
    for(int i=0;i<size;i++)
    {
        String val=rdBtn.get(i).getAttribute("value");
    
        if(val.equals("Documents"))
        {
            rdBtn.get(i).click();
            break;
        }
    }
    WebElement save=driver.findElement(By.name("register-button"));
    save.submit();

} enter image description here

Rutvi Soni
  • 536
  • 1
  • 11
  • 27