Desktop Application Click if is Button Enabled

Dear Team,

I have desktop application to generated daily report, I have managed to automation till generation, now i am stuck at report export to excel file activity, button is disabled till the time data generate and display in grid and once data loaded, export buttons gets enabled like Export to Excel, Export CSV etc.
I want to check whether these buttons are enabled or not, if enabled then execute click button activity on Export to Excel file

please asssit


You can use “element exist” activity which will return Boolean values (True or False) and then you can specify the task in if loop with regards to what it should do on each condition.

There is another way, You can use “click activity” (element) and specify the particular button (Export to excel). The activity will wait for 30 secs (default - You can increase or decrease this value under TimeoutMS) and as soon as the element appears it will click on it

1 Like


Just to add - if the button exists all the time (since you mentioned it’s disabled), you may want to check WaitAttribute activity - check with UiExplorer what attribute changes (aastate?) and use that in conjunction with modiying timeout as @Vikas.Jain suggested.


1 Like

As @andrzej.kniola and @Vikas.Jain suggested you can use both way. different peoples have different ideas and approaches.
You can also use Get Attribute Activity to get an aastate attribute if it is disabled then it’s value will be unavailable, focusable and if it is enabled then it’s value will be focusable.
according to this activity output you can proceed further.

You can use UI explorer also to get attribute or can inspect them for desktop and web based apps.



Thanks Team for your prompt response and help
I am sure your suggestion will help a lot, I will implement and let you
know in case any issue

ravi shiggavi

I am new to RPA and UIPath and I would like to get trained on this tool, please let me know if anyone gives training on RPA tools, my email :

Thanks and Regards,
ravi shiggavi (9930131312)

Hi Guys @Vikas.Jain, @andrzej.kniola,

As a sample practice I’m trying to automate the source tree fetch process, where at some point it may either fail or complete successfully and the close button is enabled.

In this process, first step is to close the button, no matter “completed successfully” or failed with errors.

I can work this out by setting “Delay After” to 10000ms in the previous activity before clicking close.

As per the discussion already happened here, I like to understand we have multiple options to solve this,

I need some more clue how can i proceed with the options suggested.

Can someone please detail,

@aksh1yadav @Vikas.Jain @badita - Hello Guys, Can you please help me with below post which is very much similar but in a citrix environment. Do I have to only rely on image accuracy and recognition? Do you think there can be any other approach? Kindly help.