← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #465418]: HoWTo: Mac: capture menus and popups - deal with images on retina displays

 

Question #465418 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/465418

Summary changed to:
HoWTo: Mac: capture menus and popups - deal with images on retina displays

Description changed to:
******* capture menus and popups
SikuliX IDE has a capture hotkey defined, that can be used this way:
- have the IDE open and prepared for capturing (e.g. image = )
- drive your app to the situation, where your need to capture something
- (do not go back to the IDE in this moment)
- press the capture hotkey
- back in the IDE you will find the image added
hotkey Mac: shift-cmd-2
Windows/Linux: shift-alt-2
(can be modified in the preferences)

******* images captured with Mac capture feature on Retina displays
internally on Macs with Retina displays, native images have 4 pixels for one normal pixel, leading to double width and height. Without manipulation these images cannot be used with SikuliX. The capture in SikuliX (IDE) works because since Java 1.7/1.8 this is internally handled by Java. The trick is to simply resize the images to 50%. Currently this has to be done manually for images captured outside the IDE.

A workaround from comment #3:
one suggested solution is to use automator to write folder filter action to scale image to 50% when ever an image is created.

Another workaround:
If you know, that you are working with retina images, then you can resize them before use (SikuliX 1.1.1+):
img = Image("your_retina_image_name.png").resize(0.5)
... and now use img instead of "your_retina_image_name.png"

I guess, I will find a way to make this automatically internally in the
future ;-)

------------------------------------------------------------------------------------------------

Description of my issue: unable to capture My OSX app options screenshot
from Sikulix IDE

More Detailed Description:
I am trying to use sikulix and java to automate our OSX application testing. When I use CMD+Shift+4 to capture the screen on my MAC, and try to click on the image by using s.click(pattern), i am getting region find failed. 

There was another question of the same sort having screen capture
resolution issues if we are using retina display MAC.

So I am using Sikulix IDE to capture the screen shots and using them in
my java program.

Now the problem is that i am unable to capture my osx app options from
sikulix ide because as soon as i click on any option in sikulix, My app
options disappear on the top and I see sikulix option. so i am unable to
capture region of my app options.

Can some one tell me 
1. why am i unable to use images which are captured using CMD+Shift+4 . whats the workaround i need to do to make this images work for my sikulix java automation
2. using sikulix ide,, how can i capture other destop app options?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.