Designate secured strings in automation tests

Perfecto supports secured strings in automation tests through the prefix :perfecto:secure. You can add this prefix to the parameter value (for example, a password) of any command, as shown in the following code samples. The prefix is case sensitive. It works:

  • With all versions of Selenium and Appium

  • On web, mobile, and virtual device platforms

Using the prefix ensures that sensitive parameter values are hidden in the Smart Reporting UI. In the logical steps pane of the single test report (STR), such values now display as ****, as shown in the images included with the code samples.

Copy

Example 1

driver.get("http://google.com");
WebElement p=driver.findElement(By.name("q"));
p.sendKeys(":perfecto:secure:Selenium Java");

Example 1 of string secured with :perfecto:secure prefix in Perfecto report

Copy
Example 2
Map params=new HashMap();
params.put("password", ":perfecto:secure:60");
params.put("not_a_password", "60");
driver.executeScript("location.reload()", params);

Example 1 of string secured with :perfecto:secure prefix in Perfecto report