Try catch don't work

Hello! I find the element and its relative element on the web page.
If relative is not, then an error message

I did:
In try:
find element, find relative element
catch:
SelectorNotFindException
message box
BUT I have:
Find Relative Element ‘DIV’: Cannot find the UI element corresponding to this selector:

1 Like

hi @RPA3
in catch block, change the exception to System.Exception.
Regards!

Doesn’t work, same error

Something must be wrong in your project, i never seen a try catch not working before… can you share so we can help you find it?

Can you try the debug mode for you to see if you really get some error @RPA3

cheers :smiley:

Happy learning :smiley:

1 Like

I sent you message

Well it seems ok, if this is really happening, maybe open a ticket with support, but in the meantime, remove the try catch and use ContinueOnError=True on the find relative element activity, the use an IF to see if it find or not something…

1 Like

What write in IF?

IF NOT myRelativeElement IS Nothing

  • i found relative element

I put the message box, in both cases it goes

maybe in your application this element is always present but not always visible, so maybe try using WaitVisible= true

no:(

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