Skip to main content

Hiding Sensitive Data

Beta release

Sauce Labs Mobile App Distribution offers a valuable feature that allows developers to conceal sensitive information from recorded sessions, ensuring that sensitive data, such as credit card information, remains protected during testing and debugging.

For example, you might want to prevent all information related to credit card data from appearing in the session:

To hide a view from video, all you need to do is the following:
TestFairy.hideView(Integer.valueOf(R.id.my_view));
or
TestFairy.hideView(View myView);
Replace R.id.my_view with the identifier of the view you wish to hide. Review the full example below:Example
public class MyActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
setContentView(R.layout.my_activity);

TestFairy.hideView(findViewById(R.id.credit_card));
}
}

Example​

Below are two screens from a demo video. On the left is the app as it normally looks. On the right, the Card Number field is hidden with hideView.

iphone no hidden HTML elements iphone hidden HTML elements
note
  • Hidden views are automatically removed from the video before being sent to Sauce Labs Mobile App Distribution's servers, ensuring that sensitive data is never captured or exposed.
  • Developers can hide multiple views in a session to protect various sensitive elements in the application.
  • It is permissible to add the same view multiple times for hiding without any additional checks.