Translate clipping region UIPath Fault?


#1

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.


#2

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.
Scrape%20Error


#3

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.


#4

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)