Other ways to identify UIElements?

Good morning! Hopefully an easy question for everyone this morning. I have some processes that have triggers set up. I keep running into a problem where it can’t find the page log-in button (which then fails the process). I even set two different “check app states” to look for it, depending on the circumstances. Is there a way for me to set it as the button ID from the code, or is there another way to have my bot track that button and click it?

1 Like

Hi @Primal
Try to put the click button inside an “On element appear”. That worked for me in a similar issue.

1 Like


this is currently how I have it set. Is this what you are talking about?

1 Like

Yes. Same thing:
image

and what exactly causes the error? the button does not appear after 5 seconds? did you try to increase the timeout(maybe 30 seconds?)

1 Like

Yeah, I have been playing with the timeout. The login screen has two versions, and it’s always a guess which one will be appearing, so I have two check app states set to look for either one, but it will be running OK multiple times throughout the day, then it will just fail because it can’t find the UI Element on the log in page. It does it at least a few times a day. I just now swapped from fuzzy selector to strict selector in hopes that that may be the resolution, but I am not sure.

1 Like

The strict selector will probably make the click more stable.
Now if that doesn’t work for you, maybe you can try with a parrallel activity to handle the click in both versions at the same time (start with checking if the button exists with an element exist in both branches). Also if that’s not already done, add a screenshot at the moment of the error to see what’s happening on the screen at that time (maybe the error occurs more on one version of the page than the other, does the button really appears and the click fails or the button is not at the screen yet), that will definitely help in finding the appropriate solution.
As a last solution, try with click => Image (without any selector, and relying only on the image of the button), i had used this option on highly dynamic elements where selectors where not stable, and that worked fine.
Let us know how it goes :slight_smile:

2 Likes

Look into the pick / pick branch setup, not the parallel setup. (Parallel is evil!)
It is a wee bit more complicated to use in modern experience (as is almost everything… vote for classic :smile: )
If you set up a pick activity, and within that activity 2 pick branch activities you are set.
As condition you do a element exists, one for each login button. As action the matching logon actions.

Your bot will validate both conditions (sort of parallel) and once a match is found it will follow that branch and ignore the rest. It is perfect for your use case. If you have more conditions such as an already logged in application, add a similar condition for an element specifically for a logged in page.

Note: if none of your conditions are met, it will select your 1st branch as a default.

1 Like

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