"Verify Element Not Clickable" fails while button is disabled

Hi.
I have a test case where I want to check that button is disabled on the form, so I selected “Verify Element Not Clickable” for it, but it keeps failing saying that button is actually clickable.

button_disabled.png

check_fail.png

Have the same issue. Does enyone knows how to solve this? Or do we need to use something else to check disabled button?

Hi guys,
With this keyword, the web element MUST have "disabled" as the input element. Otherwise, the keyword “Verify Element Not Clickable” won’t work.

keyword.png

Is there a workaround for it?

Alina Poceviciene said:

Have the same issue. Does enyone knows how to solve this? Or do we need to use something else to check disabled button?

I just found a workaround.

Use WebUI.verifyElementAttributeValue to see if your object class contains disabled.

You can also just use an assertion call.

2 Likes

Jun-Ho Kim said:

Alina Poceviciene said:

Have the same issue. Does enyone knows how to solve this? Or do we need to use something else to check disabled button?

I just found a workaround.

Use WebUI.verifyElementAttributeValue to see if your object class contains disabled.

You can also just use an assertion call.

I think it will be **WebUI.verifyElementHasAttribute **

Hi, same issue here.

Hi folks…
use “verifyElementNotClickable” or Verify Class name. its work.

1 Like

Thanks guys, I did this way and it works for me:
def hasClass(def objectId, def className ) {
return WebUI.executeJavaScript(“return document.getElementById(’”+ objectId + “’).classList.contains(’” + className + “’)”, null)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.