OCRExtractRelative not finding green and pink boxes

Hello,

I am using the “OCRExtractRelative” command but am running into the following error:

image

Here is the image:

image

Anyone know what the issue is??

Hi, can you please post the same test image without green/pink box? I want to test it here and add the frames myself.

Hi,

I get the same error with XClickRelative or OCRExtractRelative:

     [error] Cannot find green and/or pink boxes

I am not sure if it has something to do with Windows, but I observed the following when I used a tool to get the visible colours:

When the green and pink boxes are created the colours match #00FF00 and #FE1492.
The lines of the boxes have an outer shaded colour and the inner colour matches.

But if I open the window again, then the displayed line colors have changed:

The anchor and it colour:

image

I tried restarting my computer, I tried changing the Display Settings ‘Color profile’.

The computer is an MS Surface Pro 7 with 2736x1824 resolution.

I tried to see if I could find the file with the green and pink boxes, in order to check the actual colour of the boxes in the png files.

I cannot find the png files on my pc:

See my next response below, for the location of the png files.

I found the vision files renamed by Chrome here:

C:\Users\geard\AppData\Local\Google\Chrome\User Data\Default\File System\047\t

I copied the files and added the .png file type.

The colours of the pink and green boxes do NOT MATCH the codes #00FF00 and #FE1492

00000650

Next, I opened the Image Editor (RPA Computer Vision) and added the pink and green boxes.
Before you save it the pink and green box colours are correct.

I snipped the area, saved it a png file and replaced the file that was saved by Chrome.
C:\Users\geard\AppData\Local\Google\Chrome\User Data\Default\File System\047\t\00000650

This worked and I DID NOT GET this error: Cannot find green and/or pink boxes

Interesting. So you think something changed the color of the boxes and/or added this fuzzy frame to it?

And just to clarify: Now it works ok?

I found the vision files renamed by Chrome here:
C:\Users\geard\AppData\Local\Google\Chrome\User Data\Default\File System\047\t

Just FYI: This is in HTML5 storage mode. In hard drive storage mode the image files are in the UIvison (xfile) xmodule root folder/images.

Yes, it looks like Chrome changed the colour somehow.

The XClickRelative or OCRRxtractRelative got past the green/pink box error, they had no reported errors but did not seem to find the text box. It could be that the snipped window does not work fully

I am using a Microsoft Surface pro 7 with Chrome Version 83.0.4103.61 (Official Build) (64-bit).

And UI.Vision is using Local Storage (in browser)

Do you use a HDPI screen or is it the standard 96dpi? You can see this in the _dpi_XX.png that UIV adds when grabbing screen elements.

I ask because the green/pink box detection seems to have a problem on some(?) high-dpi screens.

dpi96

My MS Surface screen has 2736 x 1824 with 267 PPI.

I tried changing the display resolution to 1280 x 720.
I got no errors but it put the text in the wrong field (last text entry field at the end of the screen).

The file that I used in the XClickRelative target field is named: cust_lowres_dpi_87_relative.png@0.1

Thanks.

Hmm, that seems wrong. Was this number created by UIV? It should be 267.

I tried changing the display resolution to 1280 x 720.

If a screen is HiDPI changing the resolution does not help in my experience.

Possible solution: Instead of running the automation directly on this laptop, I suggest to run it inside a virtual machine like Virtual Box. This will give you the standard 96 dpi resolution. You can use either a Windows VM or a small and lightweight Ubuntu VM. You can download complete Ubuntu VMs from Ubuntu Virtual Machine Images for VirtualBox and VMware - and then just install UIV inside.

Thank you, I will try a VM later.

What determines the dpi_ number? I set the resolution back to the highest setting but the target file number kept defaulting to dpi_87.

Hello,

The XClickRelative command found the correct text boxes with a Microsoft VM.
(I intend to also have a Linux VM after the Windows 2004 update).

The target file in the command defaulted to dpi_144.

Next as a test, I attached an external monitor and slid the VM there, it does not find the fields in the VM on the external monitor (creating the green and pink boxes again will result in the green and pink boxes not found error). This external monitor is a high definition quantum dot screen. So that may be the issue there.

Yes. This confirms that green/pink boxes are not correctly detected on HiDPI screens, but work ok on standard 96dpi screens. Thanks for testing this!

The new xmodules V2021-1 fix this issue.