How to set the region for the Wait For Element

Please, what is the procedure to set a region to quickly search for an image on a screen with RPA.DESKTOP?

Hi @gazeta.julio and welcome to the forum!

Currently RPA.Desktop library does allow you to specify a screen region to search from. It will always search the full screen. However, I believe you could do that by first taking a partian screen shot and then searching from that image e.g.

*** Settings ***
Library  RPA.Desktop
Library  RPA.recognition.templates

*** Tasks ***
Minimal task
    Take Screenshot  shot.png  locator=region:0,0,200,200
    ${result}=  Find  image=shot.png  template=template.png

Hmmm… Seems that I cannot find RPA.recognitation package’s API docs anywhere. I’ll try to figure out where they are :cold_sweat:

I just heard that recognition API is not mend to be used directly from Robot - thus no API docs :man_shrugging:

Here is the new version that uses RPA.Images

*** Settings ***
Library  RPA.Desktop
Library  RPA.Images

*** Tasks ***
Minimal task
    Take Screenshot  shot.png  locator=region:0,0,200,200
    ${result}=  Find Template In Image  image=shot.png  template=template.png
1 Like

Thank you Tepp, this tip helped a lot!

1 Like