Translate clipping region UIPath Fault?

I’m having issues using using relative OCR screen scraping in a loop. After a lot of trial I have narrowed the issue down to inconsistency doing the translation for the clipping region. The first time the code runs it correctly scrapes the correct area on the screen, however the subsequent scrap is incorrectly translated. Yes the first thing I tried was to make sure the clipping area is being rest before hand, this is not the issue.

So what I did was to enlarge the scrape area and took screen shots before and after the translation. Immediately after the Find Image it would correctly show the image I was searching for so the clipping region was set correctly. However after the translation the screen shot would be correct the first time around, the second time in the loop it would push the clipping region further left and it would become wider. After a bit of trial and error I was able to use an If statement and a second translation to correct the translation on the subsequent loop (21, 1, -46, -1), however on the third loop I could see that it was continuing to deviate from the required position.

So it appears that the Translate is introducing an additional offset each time. From my experimentation I suspect that the additional offset is some how related to the position from where the OCR finished scraping during the previous Get OCR Text activity.

The screen shot below shows the area scraped during the first loop in red. The result from second loop is shown in blue. As previously mentioned the label “State” was correctly identified in each case, however the translate yielded different results.

Below “OCR - Get State Displayed” is the part in question. The take screen shot activity was used to produce the above composite screen shot.

Unfortunately the forum is preventing me from uploading the attachment at this stage.

Can attach now :slight_smile: I was using the forum without an account for a long time otherwise would have got basic level sooner…

Attached is the project, note that it contains commented out activities that I used to attempt to correct the translation issue.
Main.xaml (49.1 KB)

1 Like

Hello there,
any update on this topic? I think I have the same issue working on a for each loop on pdf files.
The bot gets properly the first occurrence of the relative element and OCR works fine, on the second occurrence the clipping region shift a bit from expected, it gets a blank space on the PDF sheet and the OCR crashes.
You can see it clearly through highlight activity


i am facing the same issue too
wondering if smthng u tried have worked?

please suggest