I want to test for checkbox checked or unchecked condition.
This is the html code for checkbox checked
<
In my case, I have removed the pseudo-element ::before
from the CSS selector as seen below and it works
Actions action = new Actions(driver);
action.moveToElement(driver.findElement(By.cssSelector("span.check::before"))).build().perform();
Actions action = new Actions(driver);
action.moveToElement(driver.findElement(By.cssSelector("span.check"))).build().perform();
Using pseudo-elements in the selector is actually not supposed to work as mentioned here and here.