Skip to content Skip to sidebar Skip to footer

How To Take Screenshot In Aws Device Farm For Android Espresso Testing

I am using aws device farm for running my android tests, and we are using espresso framework. Some of the tests are failing today, and I want to take screenshots if my test fails.

Solution 1:

Disclaimer: I am a developer working on AWS Device Farm.

That bit of documentation about the takeScreenshot method is for uiautomator 1.0, not uiautomator 2.0 which works in conjunction with Android Instrumentation/Espresso.

I don't believe Espresso has added built-in functionality for capturing screenshots. However, if you take a look at the official AWS Device Farm Sample App for Android, there is a helper class ScreenShot.java that you should be able to use directly from your Espresso tests.

Hope that helps!

Best, Andrew @ AWS Device Farm

Post a Comment for "How To Take Screenshot In Aws Device Farm For Android Espresso Testing"