Problem
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 | Keyword | Object | Data |
---|---|---|---|
copyStringValueTo | String to Store : String1 (data type : Fixed Encrypted) | ||
Component 1 | setValue | username | Value : username (data type : Stored Variable) |
setValue | password | Value : var (data type : Stored Variable) | |
<Steps to execute> | |||
Component 2 | verifyElementVisible | Login | |
copyStringValueTo | String to Store : String2 | ||
Component 1 | setValue | username | Value : username (data type : Stored Variable) |
setValue | password | Value : var (data type : Stored Variable) |
When you execute such test, the encrypted value is not displayed as encrypted while execution.
Solutions
Solution A : Using copyStringValueTo & setValue keywords
Steps :
Use copyStringValueTo as expected
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 )Use setValue
For param 1 (Value), select Fixed Encrypted as the data-type and enter variable name within curly braces ( Ex. {{var}} )Save and Execute the test.
Result :
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).
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.
Add Comment