At times, sensitive data needs to be encrypted, like passwords, in a Web Test case.
Web Test Cases that contain sensitive or secure information, such as API keys, usernames or password credentials, these values can be encrypted within the Test Case itself.
Once the values are encrypted, the Test Case will decrypt the values prior to sending them to the Web Application being tested.
The following examples illustrate the steps on creating Test Cases using encrypted values.
Create the attribute value to be encrypted.
To create a secure value for a Web Test Case, create an Attribute with a prefix of "Secure".
Example:
To create an encrypted field for “UserName”, first create the Attribute with a “clear text” value.
Once the test case is saved, it will encrypt the value.
Subsequent editing of the test case will only show the encrypted value.
The Test Case will decrypt the values prior to sending to the web app.
Create the reply step using the encrypted attribute.
Once the attribute is created, you need to use a certain format in the test case step to use the encrypted value.
The format to use in the reply step must have:
{Insert TestCase.Secure.WHATEVER}
(The WHATEVER is the name of your Secure attribute that was created in the earlier step.)
Example of using a “function” in the Test Case reply step:
The Test Case reply step with secure values of UserName and UserPassword:
(Assuming your selector name is “#Selector_name”)
SetValue("#Selector_name”,”{Insert TestCase.Secure.UserName}")
SetValue(“#Selector_name”,”{Insert TestCase.Secure.UserPassword}")
Example of using a Message Resolver in the Test Case reply step:
Assuming a Message Resolver named “SendName” is used, with an input parameter of “UserName”, and a second input parameter of “UserPassword” are required.
SendName("{Insert TestCase.Secure.UserName}",”{Insert TestCase.Secure.UserPassword}")
Comments
0 comments
Please sign in to leave a comment.