I want to test for checkbox checked or unchecked condition.
This is the html code for checkbox checked
<
I'm not sure of your exact html as the comment mentions there is no ::after
in your example html. Based on your description this seems similar to the below, but not sure if that is what your exact situation is.
I have utilized the mouse move and then wait for the element that displays the modified css/class. The mouse would move and hover to the first element and then wait for the second to appear on the screen. This works similarly for click and then wait for element to appear.
Hover code example - needs to match your code language and structure...
[Actions Instance goes here].MoveToElement([IWebElementGoesHere]).Perform();
you can also just do
[Actions Instance].Click([IWebElementGoesHere]).Perform();
Reference for this library: https://code.google.com/p/selenium/wiki/AdvancedUserInteractions