Add support for automated screenshots at end of failing tests in ui automator.