Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If we wish to pass the encrypted value as a stored variable, the encrypted value is not displayed as encrypted while execution.

Suppose you have created a workflow that re-uses a component & you pass the values as stored variable before calling that particular component.

Ex.

...

Component

...

plain text in logs and results during execution. This scenario normally happens when you want to pass encrypted values from a workflow using stored variable to a reusable component as shown below. This is a common scenario when reusing Login component in different workflows where you need to use different User credentials for each workflow.

setValuesetValue

Step #

Component

Object

Data

copyStringValueTo1

String to Store : String1 (data type : Fixed Encrypted)
In variable : var
Left Boundary (Optional) :
Right Boundary (Optional) :

2

Component 1

username

Value : username (data type : Stored Variable)
Execution Mode (Optional) : setValue

password

Value : var (data type : Stored Variable)
Execution Mode (Optional) :

<Steps to execute>3

Component 2verifyElementVisible

Login

copyStringValueTo4

String to Store : String2
In variable : var
Left Boundary (Optional) :
Right Boundary (Optional) :

5

Component 1

username

Value : username (data type : Stored Variable)
Execution Mode (Optional) : setValue

password

Value : var (data type : Stored Variable)
Execution Mode (Optional) :

...

When you execute such test, the encrypted value is not displayed as encrypted while execution.

Solutions

Solution A : Using copyStringValueTo & setValue keywords plain text. This may not be the desired or expected behavior. There are two solutions to work through this constraint.

Solution 1 : Use values from Data table

If the workflow uses the Login component only once, then this solution works best.

  1. Break the workflow into multiple tests so that the particular component is used only once in the test.

  2. In the component use the encrypted value from Data table Encrypted

    Image Added


    Image Added

  3. Save the test & execute them.
    To execute the tests locally, in order to debug, do not forget to add launchApp keyword in the beginning (if not already added).

Result :

The encrypted values are displayed as encrypted.

...

Solution 2 : Use Dynamic Variable Substitution Mechanism using {{ }}

This is the most flexible method to pass and use values anywhere in the test. This works even if the same component is used multiple times in a single workflow with each usage of the component requiring different values.

Steps :

  1. Use copyStringValueTo as expectedto store the encrypted value into a variable
    For param 1 (String to store), select the data-type as Fixed Encrypted & enter the string to store.
    For param 2 (In Variable), enter the variable name ( Ex. var )

  2. Use setValue to use the value set in the variable in step 1 above.
    For param 1 (Value), select Fixed Encrypted as the data-type and enter variable name used in step 1 above within curly braces ( Ex. {{varpassword}} )

  3. Save and Execute the test.

...

The encrypted values are displayed as encrypted.

...

Solution B :

...

Break the workflow into multiple tests so that the particular component is used only once in the test.

Then pass the value of the component as Data Table Encrypted.

...

...

Save the test & execute them.
To execute the tests locally, in order to debug, do not forget to add launchApp keyword in the beginning (if not already added).

Info

If you wish to run the tests (created following Solution B) remotely, then follow the below steps :

  • Create a suite

  • In the suite, add the tests one by one, in correct sequence.

  • Navigate to the execution screen.

  • Select the Suite and execute the tests.
    The correct values will be fetched from the data grid.

Result :

The encrypted values are displayed as encrypted.

...