I’m working a solution and inside my code I add a try/catch sequence.
I’m trying to get the short message from the exception.
I have a dynamic selector inside a click activity (any special setup)
When the selector failed, it showed the next message:
Exception.toString :
Search Company SNNs: Could not find the UI element corresponding to this selector:
[1]
Search failed at selector tag:
[1]
The closest matches found are:
[75%]
[50%]
[50%]
[50%]
[50%]
[50%]
[50%]
[50%]
[50%]
[50%]
But when I tried to use
Exception.message.toString I hope short message but instead of short message, the uipath display a Long message (similar to use Exception.ToString)
UiPath.Core.SelectorNotFoundException: Could not find the UI element corresponding to this selector:
[1]
Search failed at selector tag:
[1]
The closest matches found are:
[75%]
[50%]
[50%]
[50%]
[50%]
[50%]
[50%]
[50%]
[50%]
[50%]
at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)
at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)
at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
UiPath.Core.SelectorNotFoundException: Could not find the UI element corresponding to this selector:
[1]
Someone kwno how I can pull only a short message?
For example: Could not find the UI element corresponding to this selector:
Thank you all,