Securely storing passwords and login details with Set Encrypted Text in Katalon Studio

One of the new features for Katalon Studio 5.4 is the ability to store encrypted passwords right inside the test case using the Set Encrypted Text command. Previously, the username and password would be in clear text, so anyone who opened the file could see the login credentials. This now obscures that information while still allowing easy access.

The new command is available while editing the script in Manual mode. Change the normal Set Text command to Set Encrypted text, which brings up a small dialog window that encrypts the text as you type.

set-encrypted-text

With the Item column now changed, double click the input field to bring up the encrypted text dialog box. On this new input screen, click the Value input field and you will be able to type in your text and see the encrypted text. This is what will be saved in the Test Case.

input-encrypted-text

For the login test I have, I check to see which environment the test is running against and then pass the credentials for that environment. By simply changing the Set Text command to Set Encrypted Text, I obscured the username and password in mere moments.

The test now looks like this:

if (GlobalVariable.baseurl == 'https://myqasite.com') {
    //QA credentials
log.logWarning('Logging in to environment - ' + GlobalVariable.baseurl)
    WebUI.setEncryptedText(findTestObject('Page_Sign In/input_UserName'), 'XJ419vj6YqJLWAYDfHAYjLzfymSmyhCi')
    WebUI.setEncryptedText(findTestObject('Page_Sign In/input_Password'), 'e71pytG/LEFOTYb/96yNYh7DOujSLkGz')
} else {
//Staging and Prod credentials
log.logWarning('Logging in to environment - ' + GlobalVariable.baseurl)
    WebUI.setEncryptedText(findTestObject('Page_Sign In/input_UserName'), 'cbbsN3ywIVYTVYg1DVaCdC/EYK/MbMZwGmSPgZHWhNTAx6OdO9Wh9w===')
    WebUI.setEncryptedText(findTestObject('Page_Sign In/input_Password'), 'MihRDM3OZ2lC85FtfophvXwNOqe+xiW4fjG2a5CVrjqCtbHeBRcgvw==')
}
WebUI.click(findTestObject('Page_Sign In/span_Sign in'))

This is a pretty nice feature, and even if you’re just working in a QA or Staging environment, it’s nice to now you can obscure sensitive text from others who might be working on the same project, or from someone who might take a glance at the screen.

This space for rent.

Author Signature for Posts

2 thoughts on “Securely storing passwords and login details with Set Encrypted Text in Katalon Studio

    • Author gravatar

      Hi Don,

      Is there a way to set the encrypted text to be used in the ‘WebUI.authenticate’ method?

      Basically I am trying to encrypt the password that is passed to the ‘WebUI.authenticate’ method.

      Thank you.

    • Author gravatar

      hi
      can u please help me how to read data from text file in katalon studio?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.