For some reason WebUI.verifyElementChecked does not work. Well on same radio button, check method is working and it checks the radio button, but I can’t verify that the element was checked using WebUI.verifyElementChecked()
And here is the error message:
Did you verify visually that
WebUI.check is actually checking the radio?
What does this do?
attr = WebUI.getAttribute(findTestObject('...'), 'checked')
println the value returned or use
if(...) on it.
it prints null for some reason.
attr = WebUI.getAttribute(findTestObject('Object Repository/LoginPage/rememberMe_LoginPage'), 'checked')
Is the element an HTML
input element with
Well that explains everything. The APIs you’re using only work on
<input type="checkbox/radio"> elements.
So, I can not use WebUI.verifyElementPresent ? How can I verify that it was checked ?
Yes, you can, but that API does not have anything to do with a
div element does not support a
checked attribute/property so the WebUI APIs
verifyElementChecked will not work.
The HTML you are dealing with is doing something “special” to handle the notional checked state. Without knowing what it’s doing, I can’t advise. Perhaps you could post more of the HTML so I can see it.
Thank you @Russ_Thomas, I will provide more HTML.
this is unchecked checkbox.
And this is checked checkbox: