appium / appium-for-mac

[deprecated] Application for automating a mac app with JSON wire protocol
Apache License 2.0
193 stars 70 forks source link

screenshot for app main window only #12

Closed fangmobile closed 10 years ago

fangmobile commented 10 years ago

I am working on a project that use Appium-for-mac for automation as well as screenshot comparison against base images (using a tool called Applitools Eyes). Current screenshot implementation makes this impossible because it takes the whole screen. Any machine change or background windows change will fail the image comparison test. Without making my app full screen or apple Scriptable, I tried a different implementation that will take screenshot of the app windows only, using CGWindow API. This is a caveat, I also lose the ability to take screenshot of the menu. Would you be willing to take a look? https://github.com/fangmobile/appium-for-mac/tree/appOnlyScreenshot Any feedback and suggestions?

bootstraponline commented 10 years ago

The code seems reasonable. I suggest submitting a pull request.

penguinho commented 10 years ago

People can always just use the shell command or AppleScript or something if they want the full screen with the menu

ERPChina commented 5 years ago

in which release I can get the fix, I am using beta3 release of AppumForMac, but still get the screenshot of full screen. Thanks!