Skip to main content

Hiding Sensitive Data

TestFairy 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 is a screen taken from a demo video: on the left, you can see what an app usually looks like; on the right is a screenshot taken with the Card Number EditText hidden by testfairy-secure-viewid.

iphone no hidden HTML elementsiphone hidden HTML elements
note
  • Hidden views are automatically removed from the video before being sent to TestFairy's servers, ensuring that sensitive data is never captured or exposed.
  • Developers can hide multiple views within 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.