Skip to main content

Mask Your Sensitive Data in Selenium Tests

Overview


Use the maskCommands capability to hide sensitive data sent to or retrieved from remote browsers at TestMu AI.

When used, this capability hides all the keystrokes and other required values, and replaces them with '*' in test session logs (both text and raw).

Syntax


Add the maskCommands capability to your desired capabilities configuration.

Syntax (Java):

capabilities.setCapability("lambdaMaskCommands", {"<array of values to be hidden>"});

Supported Values


Use the following comma-separated values to specify what data to mask.

ValueDescription
setValuesHide/Redact all the text sent via sendKeys command.
setCookiesHide/Redact all the cookies set by the addCookie command.
getCookiesHide/Redact all the cookie values obtained using the getCookies and getCookieNamed command.

Language Examples


The following examples show how to configure maskCommands in each supported language.

LanguageExample
Javacapabilities.setCapability("lambdaMaskCommands", {"setValues", "setCookies, getCookies"});
Node.jscapabilities['lambdaMaskCommands'] = ["setValues", "setCookies", "getCookies"]
C#capabilities.SetCapability("lambdaMaskCommands", {"setValues", "setCookies", "getCookies"});
PHP$capabilities["lambdaMaskCommands"] = array("setValues", "setCookies", "getCookies")
Pythoncapabilities["lambdaMaskCommands"] = ["setValues", "setCookies", "getCookies"]
Rubycapabilities["lambdaMaskCommands"] = ["setValues", "setCookies", "getCookies"]

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles