To execute some test scenarios, you use commands that send or retrieve data like email ID, cookies, credentials, etc. to or from remote browsers. In Automate, this data may appear in session logs, text, video, screenshots, and Selenium logs.
This guide shows you how to prevent this data from appearing in the session logs by:
Masking values in text and raw session logs.
Disabling specific logs (video, visual, and Selenium logs).
This will replace all keystrokes and other values with REDACTED in your Automate session logs (text and raw).
Using BrowserStack’s maskCommands capability, you can also mask the output of the screenshot command instead of uploading the image. Here is an example to do this:
It is recommended that you disable the Selenium logs since the maskCommands capability masks only the sensitive data from Text & Raw Logs. The sensitive information from Selenium Logs remains unmasked.
Disable specific logs
Apart from text and raw session logs, BrowserStack Automate also has videos, visuals, and the standard Selenium 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 Automate sessions. Use the following capability to disable it.
Capability
Value
video Use this capability to enable or disable video log of your Automate test.
true, false Default:true
The sample below shows how to use video capability to disable video recording in your test:
BrowserStack provides a visual log for 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 Automate session.
true, false Default:false
The sample below shows how to use debug capability to disable visual log in your test:
BrowserStack SDK is a plug-n-play solution that takes care of all the integration steps for you. Using the BrowserStack SDK is the recommended integration method for your project. To know more, visit the SDK core concepts page.
This will replace all keystrokes and other values with REDACTED in your Automate session logs (text and raw).
Using BrowserStack’s maskCommands capability, you can also mask the output of the screenshot command instead of uploading the image. Here is an example to do this:
It is recommended that you disable the Selenium logs since the maskCommands capability masks only the sensitive data from Text & Raw Logs. The sensitive information from Selenium Logs remains unmasked.
BrowserStack’s maskCommands capability hides data that you send to or retrieve from the remote browsers through the following commands:
Capability
Value
browserstack.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 Selenium tests using browserstack.maskCommands capability:
This will replace all keystrokes and other values with REDACTED in your Automate session logs (text and raw).
Using BrowserStack’s maskCommands capability, you can also mask the output of the screenshot command instead of uploading the image. Here is an example to do this:
It is recommended that you disable the Selenium logs since the browserstack.maskCommands capability masks only the sensitive data from Text & Raw Logs. The sensitive information from Selenium Logs remains unmasked.
Disable specific logs
Apart from text and raw session logs, BrowserStack Automate also has videos, visuals, and the standard Selenium logs. These logs can not be masked.
To prevent sensitive information from appearing in these logs, you’ll need to disable them individually.
BrowserStack provides a visual log for 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 Automate session.
true, false Default:false
The sample below shows how to use debug capability to disable visual log in your test:
BrowserStack provides a visual log for 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 browserstack.debug capability to false.
Capability
Value
browserstack.debug Use this capability to enable or disable visual log in your Automate session.
true, false Default:false
The sample below shows how to use browserstack.debug capability to disable visual log in your test: