How to use the clickable attribute

Hi guys,

I am writing a small automated test (login feature) and I need to ensure that the button is not clickable when the user does not input a password.

The clickable attribute of the “Log in” button changes from true or false as expected. My issue is that I cannot find a way to use the clickable attribute.

Can you please suggest a way forward? Thanks a lot for your help!

@luuke

you can do like this

try
{
new WebDriverWait(driver, 30).until(ExpectedConditions.elementToBeClickable(By.id(“abcd”)));
System.out.println(“abcd is clickable”);
}
catch(Exception e)
{
System.out.println(“abcd is not clickable”);
}

Thank you for helping out!

I worked around the issue by finding the element by ID and getting the text of the attribute itself.

findElement(buttton).getAttribute(“clickable”);