Guest User

Untitled

a guest
Jun 21st, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. rotateDevice(Orientation.LANDSCAPE);
  2. closeSoftKeyboard();
  3. assertActionBarTitle(getString(R.string.demo_activity_title));
  4. assertButtonsAreDisplayedInScrollView(mExpectedDisplayedButtonIds);
  5. saveScreenshot();
  6.  
  7. Bitmap bitmap = InstrumentationRegistry.getInstrumentation().getUiAutomation().takeScreenshot();
  8.  
  9. File screenshotFile = getScreenshotFile();
  10.  
  11. try (FileOutputStream outputStream = new FileOutputStream(screenshotFile)) {
  12. bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
  13. Log.i(mTag, "Saved screenshot: " + screenshotFile.getAbsolutePath());
  14. } catch (IOException e) {
  15. Log.e(mTag, "Could not save screenshot", e);
  16. }
  17.  
  18. Handler handler = new Handler();
  19. private Runnable sendData=new Runnable(){
  20.  
  21. public void run() {
  22. handler.postDelayed(saveScreenshot, 1000);
  23. }
  24. };
Add Comment
Please, Sign In to add comment