How to go to the else condition with UIElement not found?

Hello.
I have this workflow and It’s working when the robot finds the specific mail with a “Click” activity and It goes to the workflow and prints “S”, but I’m trying to print “N” when the message mail is not found and I got an error like this.

image

when The mail is not found I get a message like this.

I know that mailEncontrado is an UIElement but how could I go into the else block because I need to send a message that “Mail was not found to the user”.

image

image

image

I have properties of “click” activity.

image

By the way, Is there a way to access “Fuzzy selector” and get the value of “aaaname” and write it in the console?

Any ideas, please?

Hello @pprin001 ,

To avoid that error first check if that variable is having some values or not, if yes go with the another if to check the contains part else you can print no in the else part.

Thanks,
Sanjit

Hi @pprin001 ,

We usually take advantage of the Element Exists Activity to check whether the element we wish to interact with is present or not.

image

This activity outputs a Boolean Value, which is then put into the If Activity.
image

As for getting the Exception message, you can encase the Click Activity within a Try-Catch and capture the exception message there.

image

You can go even deeper if you really want to explore the exceptions indepth:

Exception.Message.ToString
Exception.Source.ToString
Exception.InnerException.Message.ToString

Kind Regards,
Ashwin A.K

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