assertAttribue error

I have the following two statements in my test case:

verifyElementPresent | name=ProductIsLEP
assertAttribute | name=ProductIsLEP | checked |

The element is present on the page.

The verifyElement command succeeds. The assertAttribute fails with the message “Element name=ProductIsLE not found”.

I should add that in the same testcase i have a similar sequence on the same element but using assertNotAttribute and if does not fail.

1 Like

I just discovered that assertNotAttribute returns true even if the element does include the named attribute.

For “assertAttribute”, the target should be locator@attribute, e.g.

assertAttribute | name=ProductIsLEP@checked |

Could you please try again and let us know the result.

Thank you.

I’ve made an example here https://gist.github.com/devalex88/c776e274ca95a1c96ccf031857007215.