How to check if button is active or not?

Hi guys,

I want to check if one button in app is active or not and with if activity to proceed further. The button is reconizable by UiPath (selector) but I see (there is no) no difference inside selector whether is inactive (in “grey” color) or active. Any clue how to solve this?

Thanks in advance,

P.S. I have already tried with ‘Get attribute’ activity but it has no discrepancy (path). I do not see anything opposite for which i can connect and throw an ‘if’ activity.

2 Likes

Hi @zlatko_gradascevic

Use Get Attribute Activity and pass the aastate property

based on that you can check whether the button is enabled or not

Thanks
Ashwin S

1 Like

hmm
fine if we are able to identify with a color for that element whether its active or not then
we can use IMAGE EXISTS activity where choose that element when highlighted as a image and get the output with a variable of type boolean named bool_exists

–now use a if condition like this
bool_exists = True
if true it will go to THEN part where we can use a message box as “ACTIVE in state”

hope this would help you
but still GET ATTRIBUTE WOULD WORK FOR SURE kindly try with attribute like aastate or checked

Cheers @zlatko_gradascevic

If I understood correctly ‘Get attribute’ and then in Attribute field “aastate” and then as output i.e. “aastate1” (automatically saved as generic variable) and the with if activity asstate1 in condition
message box 1 “active” message box 2 “inactive”. It throws always active (I did step back when is active and when not). It does not work!

1 Like

may i know what was the condition mentioned in IF
or
kindly try with checked attribute
Cheers @zlatko_gradascevic

in if condition i placed aastate1 (Generic value) as output from Get Attribute activity.

fine
is that expression was mentioned like this
aastate1.ToString.ToUpper(“ACTIVE”)

@zlatko_gradascevic

No, I just made with ‘Get attribute’ the path to the button which i want to test, than i wrote aastate in attribute field. Then I wrote variable aastate1 in output of ‘Get attribute’ activity and than I wrote aastate1 inside condition of ‘if activity’ with two possible message boxes. Message box 1 “Active” else message box 2 “Inactive”

aastate1 variable as output ‘get attribute’ activity is automatically generic value

Fine
can i have a view on the expression in IF condition may be with a screenshot if possible
we are almost done and this can be resolved buddy
Cheers @zlatko_gradascevic

Sorry i have no longer access to core system while company is now closed and i had to tirn off comp. (I am writing you now from handy) but i will send ,ou on Monday. Thanks for help! I am sure it only takes a one step more to do:-)

Fine
yes we are close enough.
lets see
happy weekend
Cheers @zlatko_gradascevic

Hi @Palaniyappan ,

here I am again:-)

and then IF activity


but it has no difference in message (the selectors are same no matter if button ‘Nächster Treffer’ is active or not). Do I miss something? Thanks!

@zlatko_gradascevic
Give a a try and change the condition to aastate1.toString.toUpper.Contains(“SICHTBAR”)
grafik

Can you post the details for an inactive Button as well. Maybe “ausgeblendet” or something similiar we can observe

Please find comparable Property exlorer for both cases:

and active are

I have applied aastate1.toString.toUpper.Contains(“SICHTBAR”) but it throws me always the same message (in my case “Yes”)

What I also did is that I made two get attributes (for case when button is active and one for non-active) with two different outputs. Then I compared two outputs and then i made two messages ‘They are the same’ and ‘They are differen’. They are always the same (no difference)

@zlatko_gradascevic
Can you check if the buttons have a Parent Element e.g. Pane. can you check here aastate and relativeVisibility attributes. Feel free to post a screenshot from the uiexplorer visual tree. Expand the elements around the button in a way to get an insight on what is surrounding the button.

Do you mean in this way?

and