I'm using TestCafe and would like to determine if the checkbox element is present or not. In the HTML element, if the checkbox is already checked then the attribute checked
exists otherwise not. How do I determine using TestCafe?
I used the function available in TestCafe - .hasAttribute('checked')
but the return is undefined
.
Here is the HTML code when the checkbox is checked:
<input class="jss1523" tabindex="-1" type="checkbox" data-indeterminate="false" value checked>
Here is the HTML code when the checkbox is unchecked:
<input class="jss1523" tabindex="-1" type="checkbox" data-indeterminate="false" value>
How do I solve this using TestCafe?