For AI agents and LLMs: a machine-readable index is available at llms.txt. A plain-Markdown version of any documentation page is available by appending .md to its URL.
Skip to main content

Disable Screenshot Block for Android

Real Device Virtual Device

Introduction​


If your app doesn't allow screenshot to be taken of the app and you want to test your app's performance without any hindrance, you can use this tool. You can test your apps with this tool in our app-live tests and app automation tests. This document details all you need to know about the tool.

TestMu AI now supports disable screenshot block for Android real devices. This new feature allows you to test your application on our platform without any issue of video coming black in between or screenshots of the app not getting captured(due to app's properties)

info

OS Version: Android Disable Screenshot Unblock is supported for all os versions.

This feature is in the beta phase. To enable it, please reach out to our 24x7 Chat Support by clicking on 24x7 Chat Support or you could also mail us at support@testmuai.com.

Why app screenshots and session video come out black​


An Android app can mark a window as secure with the FLAG_SECURE window flag. Android then treats that window's content as secure and keeps it out of screenshots and off non-secure displays (Android developer reference). When your test reaches a screen that sets this flag, the screenshot of that screen comes out black and the session video shows black frames, even though the app itself works.

Disable Screenshot Block lets TestMu AI capture those screens on Android real devices. In app automation, add the "enableScreenshotUnblock": true capability to the capabilities you already pass:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("deviceName", "Galaxy S20");
capabilities.setCapability("platformVersion", "10");
capabilities.setCapability("isRealMobile", true);
capabilities.setCapability("app", "YOUR_APP_URL");

// Capture screens that set FLAG_SECURE
capabilities.setCapability("enableScreenshotUnblock", true);

Before you rely on it, check these three points:

  • The feature is in beta, so it has to be enabled for your account first. Ask 24x7 Chat Support or write to support@testmuai.com.
  • It works on Android real devices.
  • It works only for apps uploaded after June 28, 2023.

Disable Screenshot Block in Real Time App Testing​


For manual testing, disable screenshot block toggle will be seen as soon as the user uploads any app.

Image
tip

After uploading your application, please wait for 3-5 minutes(depends of app file size) for the application file patching process to complete.

Disable Screenshot Block in App Automation​


For app automation also, disable screenshot block is enabled as soon as the user uploads any app.

Using desired Capabilities​

You can use the appium capability to turn the Disable Screenshot Block on in your application. Just add "enableScreenshotUnblock": true in the desired capabilities while writing the automation script.

Verified
  DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("build","Java TestNG Android");
capabilities.setCapability("name",platform+" "+device+" "+version);
capabilities.setCapability("deviceName", device);
capabilities.setCapability("platformVersion",version);
capabilities.setCapability("platformName", platform);
capabilities.setCapability("isRealMobile", true);
capabilities.setCapability("app", "APP_URL"); //Enter your app (.apk) url
capabilities.setCapability("deviceOrientation", "PORTRAIT");
capabilities.setCapability("console", true);
capabilities.setCapability("network", false);
capabilities.setCapability("visual", true);
capabilities.setCapability("devicelog", true);
capabilities.setCapability("enableScreenshotUnblock",true); // for screenshot unblock

Important Notes​

Disable Screenshot Block will only work for applications that were uploaded after 28th June 2023.

Got any questions?
Please reach out at our 24x7 Chat Support or you could also mail us at support@testmuai.com.

Help and Support

Related Articles