If the HTML DOM is
<label class='checkbox-module-container'>
<input type='checkbox' class='dummyclass'>
</input>
</label>
then you can try to click on it like below.
There are 4 ways to click in Selenium.
I will use this xpath
//label[contains(@class,'checkbox-module-container')]//child::input[@type='checkbox']
Code trial 1 :
Thread.sleep(5);
driver.findElement(By.xpath("//label[contains(@class,'checkbox-module-container')]//child::input[@type='checkbox']")).click();
Code trial 2 :
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//label[contains(@class,'checkbox-module-container')]//child::input[@type='checkbox']"))).click();
Code trial 3 :
Thread.sleep(5);
WebElement button = driver.findElement(By.xpath("//label[contains(@class,'checkbox-module-container')]//child::input[@type='checkbox']"));
((JavascriptExecutor)driver).executeScript("arguments[0].click();", button);
Code trial 4 :
Thread.sleep(5);
WebElement button = driver.findElement(By.xpath("//label[contains(@class,'checkbox-module-container')]//child::input[@type='checkbox']"));
new Actions(driver).moveToElement(button).click().build().perform();
PS : Please check in the dev tools
(Google chrome) if we have unique entry in HTML DOM
or not.
Steps to check:
Press F12 in Chrome
-> go to element
section -> do a CTRL + F
-> then paste the xpath
and see, if your desired element
is getting highlighted with 1/1
matching node.