Skip to main content
added 89 characters in body
Source Link
Rutvi Soni
  • 536
  • 1
  • 11
  • 27

I'm writing testcases to select 7 radio buttons. While select the radio button it displays run time error.

I have tried with below code :

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();
}

Below is error snap:

enter image description here

enter image description here

I'm writing testcases to select 7 radio buttons. While select the radio button it displays run time error.

I have tried with below code :

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();
}

Below is error snap:

enter image description here

I'm writing testcases to select 7 radio buttons. While select the radio button it displays run time error.

I have tried with below code :

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();
}

Below is error snap:

enter image description here

enter image description here

Display Displays error while select radio button in selenium

i am makingI'm writing testcases for theto select 7 radiobutton but display run time error while selection ofradio buttons. While select the radio button it displays run time error. public void selecttemplate() {

I have tried with below code :

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();
}

} Below is error snap:

enter image description here

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

Displays error while select radio button in selenium

I'm writing testcases to select 7 radio buttons. While select the radio button it displays run time error.

I have tried with below code :

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();
}

Below is error snap:

enter image description here

edited tags
Link
Rutvi Soni
  • 536
  • 1
  • 11
  • 27
Source Link
Rutvi Soni
  • 536
  • 1
  • 11
  • 27
Loading