-
Notifications
You must be signed in to change notification settings - Fork 585
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
Visual recognition not finding elements / capture Sikuli visual automation debug info #240
Comments
Hi Jonas @yolibernal thanks for raising this! Can you share more which operating system are you using? If using Windows, is the display magnification % set to recommended %? Can you also paste the contents of the log files from tagui.sikuli folder here? There should be a default log file for Mac and another one for Windows. I'm using macOS (High Sierra) from 2014 MacBook Air, Windows 10 and CentOS Linux without issue. Recently a couple of users running newer Macs have this problem but we can't figure out a way to replicate on other laptops. |
Thanks for the fast answer! I'm using a macOS (High Sierra) MacBook from 2015.
|
Hi Jonas, This will be hard and take some time to troubleshoot because sikuli's functions such as click and doubleClick returns either 1 / 0 to denote success / error. Following will help to capture more details to see what could be the reason for not able to click on the image -
to
|
The logs show
|
I just tested the script with an image taken with the Sikuli IDE and it worked fine. Might it be that the |
Hi @yolibernal can you try taking the same icon using 1. macOS Grab, 2. cmd+shit+4 and 3. sikuli IDE, and share the image dimensions (and dpi if available)? I googled and saw some threads online talking about retina display on macbook which can give screenshots larger than how it appears on the screen. That could be a reason as sikuli visual matching won't work if the size of the image versus how it looks on the screen differs too much. Also, for taking screenshot with the sikuli ide, how do you retrieve the image to use it in tagui? Is it you check the path of the image and copy it out to be used in tagui script? |
The dimension of the images are:
I made some further tests and the issue, in fact, seems to be with Grab. When importing the Grab images in the Sikuli IDE the visual recognition did not work again (both Grab selection and cropped Grab screenshot). But when displaying one of the images on the screen the script was able to find them, so they seem to not be a valid copy of the displayed screen sections.
When selecting them in the Sikuli IDE they get saved in the package where the scripted is saved (packageName.sikuli). From there I copied them out. So, all in all, it looks like the issue is neither with TagUI nor with Sikuli. But thanks for your help! |
Thanks Jonas! This will be a recurring problem for other users with retina displays. I'll continue looking to see if there's an easier way for users to capture images that are of the 'correct' resolutions for Sikuli visual engine to use for automation (instead of capturing image files using Sikuli IDE and copying out). |
adding some sikuli debug logs on working laptops for reference Windows - tagui_tk.log |
This part of Jonas' observation is interesting - that when the image captured by macOS Grab tool is shown in preview, the image recognition works on that image, but does not work on the actual UI element. Since this is an issue with the image capturing, shall close the issue for now, but will add on if there are better ways to capture images accurately for automation! Also, going to add a commit which will capture more detailed Sikuli debug logs, for easier troubleshooting in future.
|
Facing the same issue even when using Sikuli IDE. I am on macOS Catalina, MacBook Pro 2017. |
Check that you have Java JDK or OpenJDK 64-bit - https://github.com/kelaberetiv/TagUI#visual-automation. Then check whether it is because Catalina is blocking TagUI due to the new security restrictions - |
Hi kensoh, I'm recently started working on sikuli along with java code. I'm trying to click on image on my windows system but getting Findfailed exception. I kept images under one folder and I have given folder path to click on image. I run app on admin mode still no luck. Could you please help me on this. note : resoultion is on recommend resolution System configuration: |
Sorry @githubuser789 I was away the past few months - tebelorg/RPA-Python#144 For SikuliX issues such as using it in your Java IDE, please raise issues to SikuliX GitHub page. This project is specifically for issues for TagUI related to visual automation using SikuliX, and not using SikuliX in Java. So I don't have answers for that. |
I had the same issue, came to know that its actually a screen resolution issue in modern screens. I have 2560x1440 screen. When i installed sikulix ide, and took a snapshot from it, only 1/4th of my screen was captured. This is where i understood that it simply cant see such high resolution. I changed my resolution to 1280x800 and everything worked perfectly fine, even direct screen capture, no need to capture from sikulix ide just change resolution to older figures. I havent deep dived the reason for this, but I mostly think it is to do with some assumption by sikulix on max screen resolution i guess. Will update here once i have time to deep dive. |
Hi Abhi, thanks for sharing your findings I appreciate it! I hear before a friend was saying some Retina display the resolution density is higher, so snapshots captured with the defaulting image capture tool may be different from what computer sees. This is the issue with details on this Retina display issue and solution. User changed the PPI from 144 to 72 to get it working. |
The solution for macOS Retina display problem will be adding this line at the start of your automation workflow -
Solution first found at RPA for Python issue - tebelorg/RPA-Python#170 (comment) |
I have trouble to make the visual automation work. I installed Sikuli as described in the instructions (I think) and when starting a flow Sikuli seems to start in the background.
But when trying to interact with an element there is an error:
When using the SikuliX IDE in
tagui.sikuli
to interact with the element it works without a problem.The text was updated successfully, but these errors were encountered: