How to take a screenshot in robotium?

In this article we are going to see how to take a screenshot in an Android device while performing Unit Testing using robotium framework.

After Initiating solo, we need to use the object of solo.

-To take screenshot with default naming

-To take screenshot with our given name

-To take screenshot with our given name along with given quality

Note :
-Default naming makes the name with current date and time.
-The given quality is measured by compression rate(in integer) 0-100 of the screen shot. 0=lowest size, 100= max quality.
-By default, it saves the screenshot in "/sdcard/Robotium-Screenshots/", So if you are using emulator, do not forget keep an SD card.
-As, it will store, it will need write permission in AndroidManifest.xml
for latest revision, if we forget to permit this,



  1. it does not take the screen shot, can you tell me clearly about how to take screenshot.

    1. It takes screenshot in Sd card. Please keep sd card in avd. after taking screenshot, you can see those from Calgary of adv or device.