public static void selectCheckbox(WebDriver driver, String identifyBy, String locator, String checkFlag) {
        /**
         * Method to check checkbox values
         *
         * Accepts:
         *   - driver: the current test's WebDriver
         *   - identityBy: the type of locator to use (ie: xpath, id, etc...)
         *   - locator: the actual location value used by the identityBy attribute
         *   - checkFlag: value to say whether to keep the checkbox selected or not
         *     accepted values are "ON" to keep it checked and anything else to
         *     un-check it
         */
        if (identifyBy.equalsIgnoreCase("xpath")) {
            if ((checkFlag).equalsIgnoreCase("ON")) {
                if (!(driver.findElement(By.xpath(locator)).isSelected())) {
                    driver.findElement(By.xpath(locator)).click();
                }
            }
        } else if (identifyBy.equalsIgnoreCase("id")) {
            if ((checkFlag).equalsIgnoreCase("ON")) {
                if (!(driver.findElement(By.id(locator)).isSelected())) {
                    driver.findElement(By.id(locator)).click();
                }
            }
        } else if (identifyBy.equalsIgnoreCase("name")) {
            if ((checkFlag).equalsIgnoreCase("ON")) {
                if (!(driver.findElement(By.name(locator)).isSelected())) {
                    driver.findElement(By.name(locator)).click();
                }
            }
        }
    }