public void selectRadioButtonByValue ( final String radioButtonName , final String value ) { List < WebElement > radioGroup = driver . findElements ( By . name ( radioButtonName ) ) ; for ( WebElement button : radioGroup ) { if ( button . getAttribute ( "value" ) . equalsIgnoreCase ( value ) ) { button . click ( ) ; break ; } } }
Select the supplied value from a radio button group .