Error: Scrape returned empty text

Hello!
Please tell me. I can not handle the error “OCR: Scrape returned empty text”:
I tried to handle the error in possible ways:

  1. Set ContinueOnError to True for activity “Get OCR Text”
  2. Use a Try-Catch Block for activity “Get OCR Text” (I used SystemException and RemoteException)

In the first case, the process stops and I get an error:

RemoteException wrapping System.ArgumentNullException: Value cannot be null.Parameter name: source **
** at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at UiPath.Core.Activities.GetOCRText.OnScrapeCompleted(NativeActivityContext context, ActivityInstance completedinstance, IEnumerable1 result) at System.Activities.Runtime.FuncCompletionCallbackWrapper`1.Invoke(NativeActivityContext context, ActivityInstance completedInstance) at System.Activities.Runtime.CompletionCallbackWrapper.CompletionWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

In the second case, the process stops and I get an error:

RemoteException wrapping System.Exception: Scrape returned empty text. **
** at UiPath.Core.Activities.GetOCRText.OnScrapeFaulted(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)

1 Like

@Violet
which ocr engine you are using?

Tesseract OCR

I tested this case and when i had empty string, i used System exception and in the catch section i only put a warning log message. All the activities after this try catch activity are executed

Fine
can we try with other OCR Engines like Google and Microsoft
Tessaract would work for sure
is the region is selected correctly from where we are getting the information like is it used within any ATTACH BROWSER or ATTACH WINDOW activity

Cheers @Violet

1 Like

I changed to Microsoft OCR, but got the same errors.
Region is selected correctly since other non-empty fields in this ATTACH WINDOW are scraped correctly.

1 Like

Then is that field really having value in it,
i hope it doesnt have any value in it and thats the reason why we are not getting any value
kindly check that once because you were able to get the value for other fields so we should be able to get from this as well
Cheers @Violet

Sorry, I didn’t understand the message.
I don’t understand why the error appears even when ContinueOnError = True

well if the activity is kept in TRY CATCH block and the ContinueOnError property is set to TRUE then no exception will be coming
are we running the process in debug mode

Cheers @Violet

"well if the activity is kept in TRY CATCH block" - yes
"the ContinueOnError property is set to TRUE" - yes

But an error appears:
RemoteException wrapping System.ArgumentNullException: Value cannot be null.Parameter name: source **
** at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at UiPath.Core.Activities.GetOCRText.OnScrapeCompleted(NativeActivityContext context, ActivityInstance completedinstance, IEnumerable1 result) at System.Activities.Runtime.FuncCompletionCallbackWrapper`1.Invoke(NativeActivityContext context, ActivityInstance completedInstance) at System.Activities.Runtime.CompletionCallbackWrapper.CompletionWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

can i have a view on the xaml if possible
Cheers @Violet

Scrdata.xaml (17.5 KB)

Hello All,

We can handle this error any way. My Query is, how to stop getting this error.

When reading a captcha, same code is working in local machine but, failing in VM server showing error as Scrape returned empty string. I have checked multiple things like changing the scaling, resolution but, nothing could fix the issue.

  • What is the possible cause of this error coming?
  • What is the solution to it?
  • What all possible way we can check to solve this issue while reading Captcha? Tried different OCR Engine as well.