Skip to main content
No Result Found

Hide sensitive test data

Learn how to prevent sensitive test data from appearing in the Appium test logs in BrowserStack App Automate.

You are currently viewing the documentation for the old dashboard. We’ve revamped the dashboard experience. Explore the new dashboard now!

To execute some test scenarios, you use commands that send or retrieve data like email ID, cookies, credentials, etc. to or from remote devices. In App Automate, this data may appear in session logs, text, video, screenshots, and Appium logs.

This guide shows you how to prevent this data from appearing in the session logs by:

  1. Masking values in text and raw session logs.
  2. Disabling specific logs (video, visual, and Appium logs).

Masking sensitive data in text and raw logs

If you are using BrowserStack SDK, you can set the following capabilities in the browserstack.yml file:

Capability Value
maskCommands
Use this capability to mask the data sent or retrieved by certain commands.

Note: You can pass multiple commands in a single array, separated by commas.
Default: Empty Array

setValues
All the text sent via sendKeys command will be redacted.

getValues
All the text retrieved via get command will be redacted.

setCookies
All the cookies which are set by the addCookie command will be redacted.

getCookies
All the cookie values obtained using the getCookies and getCookieNamed command will be redacted.

Example

The following sample shows how to configure your Appium tests using maskCommands capability:

Copy icon Copy
maskCommands: setValues, getValues, setCookies, getCookies

This will replace all keystrokes and other values with REDACTED in your App Automate session logs (text and raw).

Image of Raw logs where sendkeys input is shown as redacted

It is recommended that you disable the Appium logs since the maskCommands capability masks only the sensitive data from Text & Raw Logs. The sensitive information from Appium Logs remains unmasked.

Disable specific logs

Apart from text and raw session logs, BrowserStack App Automate also has videos, visuals, and the standard Appium logs. These logs can not be masked.

To prevent sensitive information from appearing in these logs, you’ll need to disable them individually.

Disabling video logs

By default, video logs are enabled for all App Automate sessions. Use the following capability to disable it.

Capability Value
video
Use this capability to enable or disable video log of your App Automate test.
true, false
Default: true

The sample below shows how to use video capability to disable video recording in your test:

Copy icon Copy
video: false

Disabling visual logs (screenshots)

BrowserStack provides a visual log for App Automate sessions. These are screenshots generated at different steps in your test script.

To prevent sensitive information from getting captured in these screenshots, make sure that visual logs are disabled. If not, set the debug capability to false.

Capability Value
debug
Use this capability to enable or disable visual log in your App Automate session.
true, false
Default: false

The sample below shows how to use debug capability to disable visual log in your test:

Copy icon Copy
debug: false

Disabling the Appium logs

For every App Automate session, you get Appium logs by default. However, these logs can not be masked.

You can disable Appium logs by using the following capabilities:

Capability Value
appiumLogs
Use this capability to disable appium logs for your tests.
true, false
Default: true

The sample below shows how to disable appiumLogs and capabilities for your test:

Copy icon Copy
appiumLogs: false

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle