问题
I do switch often between my laptop screen and my external 24 inch monitor, and I did notice that if I take snapshots on my laptop, then if I run the script while connected to the 24 inch monitor, the test does not work correctly anymore. Same if I go the other way around, taking snapshots from the 24 inch monitor, and then run the test on the laptop monitor.
I believe this is due to the different resolution of the image; is there a way to be "resolution independent" while running Sikuli ? I did consider taking snapshots at different resolution and place everything in a list, then parse the list one element at time, until I find a match; but I hope there is a more efficient way.
回答1:
There are few thing you can try (more details here):
- Switch ClearType off (only for Windows)
- Reduce similarity score
- Turn off "Smooth screen fonts edges" (only for Windows)
If the above not helpful then not much can be done in terms of configuration. The only robust solution is to maintain multiple sets of patterns, specific to each system.
来源:https://stackoverflow.com/questions/44537136/sikuli-switching-monitor-and-resolution-invalidate-the-scripts