@@ -0,0 +1,541 @@
+package com.samsung.coreapps;%0A%0Aimport java.io.File;%0Aimport java.io.FileNotFoundException;%0Aimport java.io.UnsupportedEncodingException;%0A%0Aimport com.android.uiautomator.core.UiObjectNotFoundException;%0Aimport com.android.uiautomator.testrunner.UiAutomatorTestCase;%0A%0Apublic class TakeScreenshot extends UiAutomatorTestCase%7B%0A    public void test() throws UiObjectNotFoundException, FileNotFoundException, UnsupportedEncodingException %7B%0A        File path = new File(%22/sdcard/filename.png%22);%0A        getUiDevice().takeScreenshot(path);%0A        %7D%0A%7D%0A

Create TakeScreenshot.java