Is there any way to store passwords in encrypted format in global variables?

Currently, I can see only string type which can be used to store values in global variables. I want to store the password but in an encrypted format (same as what we get in the test case)

How to do that? any suggestions?


with this you can store anything encrypted anywhere where you can store string

1 Like

Well, I got my answer myself.

Step 1: Goto Help (in the toolbar) >> Encrypt text
Step 2: Enter the actual password (or any text you want to encrypt)
Step 3: Copy the encrypted password text
Step 4: Paste the encrypted text in the global variable and save it.
Step 4: In the script use the encrypted text using the setEncryptedText method on **WebUI
**

WebUI.setEncryptedText(findTestObject('TestObjectPath'), GlobalVariable.password)

6 Likes

Does this work only for the local profile? What if multiple users are working on the same project? Will these details be stored in a shared source control repo (e.g. git)?

Will these details be stored in a shared source control repo (e.g. git)?

Yes.

Step 4: Paste the encrypted text in the global variable and save it.

This action will be recorded as a part of the Katalon project (/Profiles/default.glbl) which will be stored in the Git repository.