I\'m trying to take a screenshot of my Android application using Robotium, I\'m using the below function that I found here.
public static String SCREEN_SHOTS
For taking screen shot at any point of the application Just write this piece of code
solo.takeScreenshot();
But don't forget to give permission in your main Application.
Make sure your emulator has some megabytes set aside for the SD card.
If you want to pull the jpg back to your PC, you can get java to run this command line:
C:\Users\Me\android-sdks\platform-tools\adb.exe pull /sdcard/test_1329402481933.jpg c:\
The reason why you are getting NullPointerException is because you are using getView(int id) incorrectly. As you are giving it an index instead of id, it will not find the view that you are looking for and thus returns null. What you want to use is following:
takeScreenShot(solo.getViews().get(0), "Test")
Which means the first view of all the views available to Robotium at a given time.