Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find element on MacOS desktop - yes think it's Retina snapshot issue #818

Closed
natngmk opened this issue Jun 6, 2020 · 2 comments
Labels

Comments

@natngmk
Copy link

natngmk commented Jun 6, 2020

Hi Ken, thanks for developing this tool. It's simple and straightforward and easy to get started.

I'm facing a little problem at the moment. I've installed and setup the following below. But somehow it's not able to find element on desktop screen, the output always returning False. I was trying to get the Calendar app icon.

But it works on Chrome browser and able to find visual elements like logos or buttons.

Did I miss something else?

Install and setup
Install RPA package from pip
Installed JDK 11 from Amazon
Allowed Java and Terminal in accessibility (in Security and Privacy control panel)
r.Init() first time setup successful

Code run
import rpa as r
r.init(visual_automation = True, chrome_browser = False)
r.exist('cal.PNG') # if true = found

The log output below didn't seem to throw any error.
LIVE MODE - type done to quit
�[RPA][STARTED]
[RPA][0] - listening for inputs
[RPA][1] - exist_result = exist('cal.PNG').toString()
[RPA][1] - listening for inputs
[RPA][2] - dump exist_result to rpa_python.txt
[RPA][2] - listening for inputs

I'm on Mac Catalina 10.15.4 (early 2015)
display default scale at 1280 x 800

@natngmk
Copy link
Author

natngmk commented Jun 7, 2020

After some time on google, suspect that Retina display could be the cause of problem. So I went to connect my MacBook to an external display and set it at 1920 x 1080. It works!

I also had a Windows setup but it didn't give me this problem. Will use this workaround for the time being :)

@natngmk natngmk closed this as completed Jun 7, 2020
@kensoh
Copy link
Member

kensoh commented Nov 23, 2020

Hi @natngmk, sorry I was away the past few months - tebelorg/RPA-Python#144

Yes, your suspicion is correct. I think I saw an open issue regarding Retina display. Will see if I can get more details from there to put this info in docs. From what I remember, the gist of the issue is on Retina display, when a screenshot is taken, it is actually a different resolution and size from the actual screen. So, using that image as an input will lead to it not being found on the screen. Because the image is quite different in size from the actual screen.

@kensoh kensoh changed the title Unable to find element on MacOS desktop Unable to find element on MacOS desktop - yes think it's Retina snapshot issue Nov 23, 2020
@kensoh kensoh added the query label Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants