Firstly, I attempted to use the element exists activity then click activity to click on a link.
But if the user does not have the correct access the link is hidden and the robot breaks as it is confirms the link exists but is unable to click on it.
Is it possible to use the ‘On Element Appear’ activity?
How would I handle the exception when it times out as the element does not appear and send an error message instead?
It seems like you already know how to use ‘On Element Appear’ activity, so I’ll skip that part.
On the exception handling, I’d suggest placing it (or perhaps a sequence of actions) in a try-catch block, so that the program can end smoothly.
Upon catching the exception, there are a few things that can be done:
Retry the action, in case the link doesn’t load in time
End the process, because the user doesn’t have the access anyway.
You could also increase the timeout of the “On Element Appear” activity, so that you lower the chances of scenario (1) happening. It really depends on how you (or the end user) would like the process to continue after that. Hope it helps!
I would suggest to set WaitForReady property to Complete in Click Activity. Click will wait until the page loads completely avoiding clicking inappropriately.
Regarding the second part on the FoundElement, you can pass it as another variable to another activity, when you need to interact with the element eg. click, type into etc. It’s an alternative to the selectors that you usually use.
Adding on, I don’t think assigning a boolean is necessary, because:
If found, ie true → Activity Proceeds to “Do” in the Activity
If not found, ie false → Exception occurs (and hence exception handling)
However, if you reallyyyy want to assign a boolean for other purposes, one way that I can think of immediately, is to Assign a True boolean value within “do” and Assign a False value within the “catch” section.