public boolean isRadioButtonValueSelected ( 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 . isSelected ( ) ) { return true ; } } return false ; }
Checks if a radio button group has the supplied value selected .