public void uncheck(String locator) { WebElement checkBox = driver.findElement(loc.autoLocator(locator)); if (!checkBox.getAttribute("type").toLowerCase().equals("checkbox")) { throw new InvalidElementTypeException("This elementLocator is not a checkbox!"); } if (checkBox.isSelected()) { checkBox.click(); } }