Checkbox function: Using below function, I want to select a checkbox and want to skip it if already selected. But isSelected() is not working, neither clear() nor isEnabled() is working.

Maybe this help you understand more: Besides 'requiredId', there is also a class that appears only when checkbox is selected say 'requireIdClassName').

```
requiredId="checkbox_id";
public void clickRequiredId() {
    if (helper.isElementPresent(helper.locateById(requiredId)) == true) {
        if (!helper.findElementById(requiredId).isSelected()) {
            helper.findElementById(requiredId).click();
        }
    }
}

```

isElementPresent:

```
public boolean isElementPresent(By by) {
    try {
        driver.findElement(by);
        return true;
    } catch (NoSuchElementException e) {
        return false;
    }
}

```

locateById:

```
public By locateById(String element) {
    return By.id(element);
}

```

findElementById:

```
public WebElement findElementById(String element) {
    waitForElement(locateById(element), 10, element);
    return driver.findElement(By.id(element));
}

```