I have many radio buttons on my screen. When a radio button is selected, it has an attribute of checked. When the radio button is not selected, the checked attribute is not
try {
if (webdriver.findElement(By.identificationMethod(value)).getAttribute(value) != null) {
passed = false;
}
} catch (Exception e) {
passed = true;
}
Was the sort of solution I used when I needed to check for element presence, however it must be noted that NullPointer errors were not caught by the NoSuchElement exception.