Skip to content
This repository has been archived by the owner on Mar 14, 2018. It is now read-only.

Issue with autoscaling (finding images) #265

Open
kenorb opened this issue Jun 1, 2017 · 2 comments
Open

Issue with autoscaling (finding images) #265

kenorb opened this issue Jun 1, 2017 · 2 comments

Comments

@kenorb
Copy link

kenorb commented Jun 1, 2017

I'm testing SikuliX on Mac using VNC client (Sharing Screen). Since full screen is not supported, I need to have a smaller window. The problem is the window can be resized to any size and code detecting the image doesn't work anymore. Once I change the size of the window, I don't know what was the previous size.

So in other words, having this code (image is the screenshot of the visual button):

region.doubleClick("1496324592713.png")

it works for only specific size of windows, but it stops working after slight size changes (the whole screen is scaled differently).

Maybe there is some other way of catching the image features (in case when OCR doesn't work either), I don't know.

What would be the solution to that problem to write more universal code? Especially to avoid retaking and replacing multiple images over again.

@glitchassassin
Copy link

You could run Sikuli locally, on the VNC server, so that the client's image manipulation doesn't affect the script. As long as the host resolution itself doesn't change, client-side scaling wouldn't have any effect.

The other option would be to disable client-side scaling in the VNC client. If the VNC host's resolution is larger than the client's screen, you might have scroll bars, but this could be an option depending how much of the screen you need to access.

@toschneck
Copy link
Contributor

@kenorb
If you wan't you can run your UI test in a Docker container, where you can specify a fixed Resolution. Basically it's like a VNC server in a container environment. This guarantees that at every run, the UI environment looks the same. See https://github.com/ConSol/docker-headless-vnc-container.

We use this concept to run our Sakuli tests (Web tests combined with Sikuli UI testing) since a while and are very happy with this. If you wan't, take a look at https://github.com/ConSol/sakuli 😉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants