How to verify the button is able to click

Hey guys,

How can I use the activity to verify that the button is clickable?
Is there anyone could help to solve the following issue? Thank you.

When I input a supplier contact, two scenarios may occur:

  1. Clicking “search”, if the supplier contact exists in the system, the “Next” button appears with a gray background and is unclickable.
  2. If the supplier contact does not exist in the system, the “Next” button appears with a blue background and is clickable.

Hello @Evelyn_Lu

You can use the Activity “Get Attribute” to check if the button is “enabled”.

Regards,
Soren

@Evelyn_Lu,

Use get attribute activity to check if it’s enabled or not. There would a property like enabled or class which will indicate the button is enabled or disabled.

On this result basis you can use If Activity for further action.

Thanks,
Ashok :slight_smile:

Hi @ashokkarale , Can I use the “Check app state” instead of “If” activity, because I’m not clear about the usage of “If” . Thanks.

@Evelyn_Lu,

Yes, Check App state will also work. Just make sure the selector is selected correctly to identify the button is enabled or disabled.

This will save you extra If activity as well.

Thanks,
Ashok :slight_smile:

@Evelyn_Lu

you can directly use check element activity

this would checks if element is enabled or disabled

cheers

Okay, what do you mean the selector is selected correctly to identity the buttons is anable or not? could you share the screenshot or example? Thank you so much.

in such scenarios we are using UiExplorer / Browser F12 Webtools and inspecting the attributes, which are triggering the enable state.

Examples:

  • class name
  • style

depending on this we can derive a strategy which allows us to detect the button enabled/disabled state.

When a found attribute is offered by a CSS Property, which is not offered by the UiPath element properties the following component can help as well

Hi @Evelyn_Lu

You can use the check element activity

Indicate the element, then create the variable it will give the true or false

Based on that you can use the activity inside if condition

Regards,
Gowtham K