Handle OCR error (or no result)

Hello,

I’m working on a process where I need to check if there is data in a table that can be refreshed by clicking on a button.

So I used a “Do While” activity. At each loop, first I click on refresh button, then I check if there is data in the table with the activity “Screen scrapper : Google OCR”. If the table is empty, I need to stop the loop.

It’s working if there is data in the table. But when the table is empty, uiPath is returning two errors :

Goolge OCR: Scrape returned empty text.
Process: Scrape returned empty text.

I tried to use the parameter ContinueOnError = true on the “Get OCR Text” activity but in the case even if the table is empty there is no error and the process is in infinite loop. So I’m not able to check the result.

Any idea how to handle this ?

Did you try to put ‘Get OCR Text’ activity in TryCatch, and when error is encountered, put in Catch Break activity. Then, if no data is scraped, loop should be stopped.

2 Likes

Indeed I think that this approach is better.

I set a “continue” variable to true by default.

I put the “Screen scraping” sequence in the try. If I catch an error, I set “continue” variable to false and in the condition of the “do while” activity I test if “continue” is true to do the loop.

It’s working. :slight_smile:

1 Like

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