Find image in a certain portion of the screen

Hi,
Is there a way to restrict the screen zone in which image recognition happens? I have a problem where there is a very similar image anchor on another part of the screen and if I could restrict the zone of search, I can get to the right match.
I couldn’t find a similar query on the forum- hence posting it as a separate query.
Thank you in advance!

1 Like

Hi @SaurabNair

Maybe you can share an screenshot of how it looks? It would help me to assist you:)
Also could you please clarify your RPA Express version?
Thanks in advance.

Hi there! Thank you for reaching out!
Here is the screenshot, the conflict is happening with the top of the page. I want to select within a menu, but the area getting selected is at the top.
I am on RPA Express 2.2

@SaurabNair
Hi again. Could you please clarify if you’re trying to use OCR on a webpage? If yes, you can select data using Xpath, not OCR. You can find more information of how to use Xpath here -https://kb.workfusion.com/display/RPAe/XPath+Guide

Also you could try to use Mouse Scroll action, so the top of the page won’t be visible.

Much thanks ! I wanted to use xpath initially - but the website redirects me to a login which pops up as a window outside the browser. I just couldn’t get around filling in the fields for it. So I ended up using image on screen. Any advice on how I can manage with xpath if the login comes outside the browser ?
Also, I have found xpath debugging very difficult- I have to repeat all steps from scratch, since the xpath requires the browser to have opened the site in the first place. When my issue is in step 100, it takes a long time to get there and try the debug. Pausing in between causes a stack removed by user error. Any advice here would definitely help as well.
Thank you!

@SaurabNair What about switching to the pop-up, fill in “login” form and then switch back to the page? As I understand the pop-up appears in the browser but in another window, as I don’t understand how can it appear outside of it.

This solution may help you to switch between tabs - Gain control of tabs for Xpath

1 Like

Hi @SaurabNair,
Were you able to solve it?

Hi,
Sorry- our server was down for a while.
Let me explain in detail :slight_smile:
I am trying to open URL1. It redirects me to a different URL in the same tab for authentication.
Now this new URL has an authentication window which is an element in the browser, but doesn’t open in the tab, it pops out. Under inspector I see that the old URL, URL1, doesn’t exist. It is the new URL and the pop out has fields in the new URL.
I tried writing the code to open URL1 and have a Window function to open the URL (authentication) window as the next step, but the recorder stops at step 1 since I cant embed a Window switch in the open browser action.
Please let me know if you need more details, any help to get this working would be super helpful.

.auth

Hi @SaurabNair,
This solution may help you

Hi @iostapuk, this worked but in an unexpected way. It did not lose control of the page and waited for sometime, so I was able to manually input username and password and then the xpaths were available.
I think my issue is due to the authentication being handled by a separate page redirect (zscaler: URL2 referred above) which then passes back the result to the original URL (URL1 in the situation above).
Net, I am able to get the xpath now but it still needs some manual intervention. Any recommendations on how to improve? Thanks much ! :slight_smile:

Hi @SaurabNair do you mean you enter your credentials manually?
You can switch to window using “Window” action and enter them