PasswordUtil Object
Supported on UFT One versions 2021 R1 and later.
Description
Enables you to use a credential management service to manage secrets and passwords used in your UFT One tests.
Currently, UFT One supports only AWS Secrets Manager and Azure Key Vault service.
Methods
![]() | Connects UFT One to a credential management service. |
![]() | Disconnects UFT One from a credential management service. |
![]() | Gets the value of a secret stored in a credential management service. |
![]() | Lists the names of secrets stored in a credential management service. |
![]() | Creates a secret to be saved in a credential management service. |
![]() | Enables you to configure settings for connecting to a credential management service. |
Connect Method
Description
Connects UFT One to a credential management service.
Syntax
PasswordUtil.Connect(serviceName, [settings])
Argument | Type | Description |
---|---|---|
serviceName | String | The credential management service you want UFT One to connect to. Possible values:
|
settings | String | Optional. The settings required to connect to a credential management service. |
Return Value
A Boolean.
IMPORTANT
Use one of the following ways to connect to a credential management service:
Define the connection information in the Tools > Options > GUI Testing > Credential Manager pane and then use the Connect method (use an empty string as serviceName and leave settings empty). See the example.
Note: In this case, UFT One connects to only the credential management service selected in the Credential Manager pane.
Define the connection information using the Setting method and then use the Connect method with serviceName set to a service. See the example.
Use only the Connect method with both parameters specified. See the example.
Example
Disconnect Method
Description
Disconnects UFT One from a credential management service.
Syntax
PasswordUtil.Disconnect([serviceName])
Argument | Type | Description |
---|---|---|
serviceName | String | Optional. The credential management service you want UFT One to disconnect from. Possible values:
|
Return Value
None.
IMPORTANT
To connect to a different credential management service, make sure to add a PasswordUtil.Disconnect step to disconnect from the current connection.
GetSecret Method
Description
Gets the value of a secret stored in a credential management service.
Syntax
PasswordUtil.GetSecret(name)
Argument | Type | Description |
---|---|---|
name | String | The name of a secret stored in a credential management service. |
Return Value
A string.
ListSecrets Method
Description
Lists the names of secrets stored in a credential management service.
Syntax
PasswordUtil.ListSecrets
Return Value
A string array.
IMPORTANT
UFT One version 2021 R1: When listing secrets stored in AWS Secret Manager, only the 10 secrets stored earliest are listed.
SetSecret Method
Description
Creates a secret to be saved in a credential management service.
Syntax
PasswordUtil.SetSecret(name, value)
Argument | Type | Description |
---|---|---|
name | String | The name of a secret to be saved in a credential management service. |
value | String | The value of the secret. Note: For a secret to be saved in AWS Secrets Manager, you can set the value to a single string or a JSON string with key-value pairs. However, a single string cannot be converted to a key-value secret on AWS Secrets Manager service page.
|
Return Value
None
IMPORTANT
Make sure that you specify the KMS key ID before you use this method to create a secret in AWS Secrets Manager. You can either define the KMS key ID in the Tools > Options > GUI Testing > Credential Manager pane or use the Setting Method.
Setting Method
Description
Enables you to configure settings for connecting to a credential management service.
Syntax
PasswordUtil.Setting(name, value)
Argument | Type | Description |
---|---|---|
name | String | The name of a parameter used for connecting to a credential management service. Possible values:
|
value | String | The value of the parameter. |
Return Value
None
IMPORTANT
To successfully connect to Azure Key Vault service, you must specify the values of tenantId, clientId, clientSecret, and keyVaultName.
To successfully connect to AWS Secrets Manager service, you must specify the values of regionEndpoint, accessKeyId, and secretAccessKey.
This method overwrites the existing connection information defined in the Tools > Options > GUI Testing > Credential Manager pane.
See also:
- Crypt Object
- DataTable Object
- Description Object
- DeviceReplay Object
- DotNetFactory Object
- DTParameter Object
- DTSheet Object
- Environment Object
- Extern Object
- Parameter Object
- JSON Object
- JsonUtil Object
- MercuryTimers Object (Collection)
- MercuryTimer Object
- NV Object
- OptionalStep Object
- ParallelUtil Object
- LocalParameter Object
- PasswordUtil Object
- PathFinder Object
- PDFUtil Object
- Properties Object (Collection)
- QCUtil Object
- RandomNumber Object
- Recovery Object
- Remote Connection Object
- Reporter Object
- RepositoriesCollection Object
- Repository Object
- Services Object
- Setting Object
- SystemMonitor Object
- TestArgs Object
- TextUtil Object
- UIAutomation Object
- VisualRelation Object
- VisualRelations Object
- VisualRelationsCollection Object
- WebUtil Object
- XMLUtil Object