Add support to automatically take screenshots in case of test failure / error for UIAutomator. #193

merged 4 commits into from Apr 2, 2013


None yet

2 participants


This pull requests adds 2 new properties to UI Automator goal :

  • takeScreenshotOnFailure that decides whether or not to take a screenshot of device when test fails.
  • screenshotsPathOnDevice that allow users to change destination folder of screenshots on device.

A typical configuration is to run ui automator tests and, afterwards to get the screenshots pulled back to the build folder.

Screenshots are taken using the utility screencap that is available on devices with SDK 16+ (the same as ui automator). It's a super fast utility to take screenshots and this works pretty well.

Pull requests also contains documentation update and tests.

Generally speaking, devs can take additional screenshots during tests as usual using either celebrity (that is built-in maven android plugin) or the new screenshot API of UiDevice offered by UiAutomatorTestCase.

@Manfred, would you like me to update the sample for ui automator tests ?

Could you deploy the plugin (again), all my tests of ui automator mysteriously fail on travis and I would like to get more information about failures using this screenshot feature.

@mosabua mosabua merged commit b7bf732 into simpligility:master Apr 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment