How to check if a click element is enabled or disabled

Hello Everyone,
Is there any way or method to find when we clicked on a button, to check whether the button clicked or not

In a website there are multiple button with same element, out of all buttons some buttons are disabled how to check which button is enabled.
Note: All the buttons (enabled and disabled) has same selector and idx id is the unique.

diffference Selector for click enabled

<webctrl aria-role='button' tag='DIV' class='panel-body ng-scope' parentclass='panel panel-default panel-appointment flex-gt-md-auto flex-100' />```

selector for click disabled doesn’t have the above node. remaining nodes are same for both,

I used find children but the element goes to every button even if it is disbaled

@krishna_r

Indicate element in ui explorer and then on the left bottom you can see properties…there you might find a property which will tell you if the button is enabled or disabled…

Sometiems isleaf property is also used for disabling…

Or a class change would besee for disabled buttons…

please verify these

Cheers

Hi @krishna_r ,

Could you check the elements (enabled & disabled buttons) using the UiExplorer and compare the attributes present. In the Left Panel, we have the Property Explorer, where most probably the aastate property/attribute would be different for the two types of buttons.

Could you check and let us know if there are changes in the aastate attribute ?

Thanks for the response, yes have checked the properties in uiexplorer,
this might provide some help, there a property called visilbility which is 1 for active 0 for inactive but i was unable to get that into selector
How to use that property
image

Thanks for the response
aastate is enabled for both types.
image

@krishna_r

You can use get attribute to get these values…and check them using if condition.these wont be present in the selector

Do a get attribute on visibility and you would get the values

Hope this helps

Cheers

This is one more property difference

image

Disabled button doesnot have this propery how to use this in any find activity

is there any way to use this in find children filter

@krishna_r

You can directly get all children…

And in loop do a get attribute for each childern and when the visibility is 1 those are the children you need…and remaining are disabled

This is how you would filter out

Cheers

Thanks let me try this out

1 Like

Hi,

Visibility is attribute is working fine but there is an exception,
There are multiple pages, one page contains all click enabled button, in one all are disabled,
the visibility attribute is working where both the types are present

@krishna_r

Check there would eb some difference on class or other attributes as well…ideally visibility should work in both cases…but check other attributes to be more sure

Cheers

1 Like

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