Retrieving secrets from the v10 Tech Preview

After you have configured HCL OneTest™ API to access the v10 Tech Preview, you can retrieve secrets from a secret collection in the v10 Tech Preview project from HCL OneTest API and use the secrets in HCL OneTest API tests.

Before you begin

You must have configured HCL OneTest API to access the v10 Tech Preview. For instructions, see Accessing the v10 Tech Preview from HCL OneTest API.

Procedure

  1. Open the Environment Editor in one of the following ways:
    • Click the Environment icon image of the icon in the main toolbar.
    • Click the arrow next to the Environment icon in the main toolbar and select the Edit Environments option.
      image of the menu option to edit an environment.
    • Select the Project > Edit Environments menu option.
  2. Select the environment in which you want to run the tests from the environments that are visible to you in the left panel. The name of the selected environment is displayed as the Current Environment.
  3. Click the v10 Tech Preview tab. Click the Override secret collection name check box and enter the name of the secrets collection in the text box.

    The Environment Editor window is displayed similar to the following sample screen:

    image of the environments editor window.

    The name of the collection (in this example is test_env) is what you created for your project in the v10 Tech Preview.
    Note:

    If you create a secrets collection in the v10 Tech Preview and name it the same as the name of the test environment in HCL OneTest API, you need not use the override option.

  4. Click the Properties tab.
  5. Create a new environment variable or tag by clicking New, and enter the following details:
    1. In the Variable Name field, enter the name for the environment variable.

      As an example, the details of the secrets collection (with the name test_env) configured in the v10 Tech Preview project is shown in the following image:

      Image of the secrets collection page from the v10 Tech Preview.

    2. In the Variable Value field, enter the identifier of the secret in the format: secret://<Identifier>. For example, secret://dbcred. The identifier is the name of the secret you created under the secret collection in the project on the v10 Tech Preview.
    3. Enter a description in the Variable Description field to enable you to identify environment variable easily.

      The following image is shown as an example with the entered details:

      Image of the new environment variable window.

      The following image is shown as an example of the Environment Editor window with the set tag:

      Image of the Environment Editor window.

    4. Click OK to save the environment variable or tag.

Results

You have configured HCL OneTest API to retrieve secrets from the v10 Tech Preview and use the secrets in tests in the selected environment.

Feedback