How to get Source of error on Use application/Browser

How can I get source of error to specify source on Use application/Browser look like this image.

image
When I try to use try…catch:exception,exception.type,exception.Source,exception.Message It’s not show any source to let me know where is error?

Hi @jnfantasy4

Please refer below thread

What is a remote runtime and how can it fix on my case?

@jnfantasy4

are you working on VM?

No,I just work with browser on sample window. Create Robot do something on website but
on real project there have too many activity of use Application/browser has use it, when have some error like “Could not find the user-interface (UI) element for this actio” appear I can’t know where source of error

@jnfantasy4,

You got two possible solutions for this.

  1. Try upgrading to latest version possible of UiPath.System.activities package. If already on latest, try downgrading and testing if it’s returning correctly.
    Why to do this?
    Because this issue was reported long back to UiPath and team worked on it and provided fix in latest versions (I didn’t found any specific release note yet but will have to dig down for it.)

  2. Instead of adding try catch into the workflow, move your logic to another child workflow. Don’t put any try catch in this child workflow. Let it throw the exception to the parent.
    In parent workflow use try catch to catch the exception and now take the exception.Source it will give you the right activity name.

Thanks,
Ashok :slight_smile:

1 Like

@jnfantasy4

Please try either upgrading or downgrading the UI.Automation.Activities package

1 Like

Hie @jnfantasy4 use try catch inside the try pass the activity and inside the catches - select -system.exception and use log or write line and pass the name as shown in the image to read exce.mess and excep.source
use that way to read the exce.message and get the exce.source
image
image


Hope you get the point
cheers Happy Automation. :grinning:

It’s just log error but don’t specify element such as: Source: Click"submit",Source: Type:“Name”,… And on my real project it’s have too many activity I can’t use try…catch on all activity ,I just use it on parent sequence or parent scope.

This is quite a chaotic thread with some quite unstructured suggestions that seem to be based on quite wild guesses such as Remote Runtime.

Regarding the error.

I personally think its bad advice to try logging the Exception Source and Exception message, particuarly with a write line as that wont go into Orchestrator logs as far as I know.

The reason is, the useful information can often be elsewhere in the exception, it could be on the inner exception, or the data. By only logging those properties you are throwing away all the other useful information you might have.

If you want to understand the error, look at the whole thing, you can do this by serializing the error to a string and logging that string.
Often you’ll find the error is really easy to understand once you look at some of the other information in the error.
An easy example, if you use a Send Mail activity with the O365 integration service and put in an invalid email you get a ‘Unspecified Error has occurred’ error message, which is pretty useless for debugging, and would be all the info you are given if you just log the message.
Had you checked the inner exception though you’d see it stating that there was an invalid email address used and immediately know the cause.

Regarding the root cause of the actual error. Its a simple element not found error. It indicates the selector you used for the submit button isnt correct, or you are telling it to click submit and there is no submit.

1 Like