Generating the test data by using UrbanCode Deploy

When you perform a test while you deploy an application on UrbanCode Deploy, you might want to generate test data. You can generate a random test data to test your application by integrating HCL® OneTest Data UCD Plugin with HCL® OneTest Data.

Before you begin

You must have completed the following tasks:

About this task

You can write the test data generated by integrating HCL® OneTest Data UCD Plugin with HCL® OneTest Data into a file or any supported database. After integration with HCL® OneTest Data UCD Plugin, HCL® OneTest Data supports the insertion of the generated test data in both JDBC supported database and MongoDB. To write the generated test data in the database, you must establish a connection between HCL® OneTest Data and the supported database.

Procedure

  1. Log in to the HCL UrbanCode Deploy server.
  2. Create a component.
  3. Create a component process, and then set the properties for the component by referring to the following table:
    Field Action Required/Optional
    Name Enter a name for the HCL UrbanCode Deploy application process. Required
    Server URL Enter the URL of HCL OneTest Server.

    The format for the URL is as follows: https://<fully-qualified-dns-name>/

    Required
    Offline Token Enter the offline token that is generated in HCL OneTest Server. Required
    Project Enter the name of your project. Required
    Schema Enter the name of the schema associated with the project you selected. Required
    Root Element Specify the root path of the element for which you want to generate the test data.

    For example, Root:NewType1

    Required
    Number of Records Enter the number of records you want to generate. Required
    Numeric Seed Value Enter the seed value that acts as an instance of random data when you generate the test data. Optional
    Data Storage

    Select the data storage type. The data storage is a location where you want the generated test data to be written.

    You can select FILE, JDBC, or MONGODB as a data storage type.

    FILE: The generated test data is written into a file and you can download it in your local file system.

    JDBC: The generated test data is written in the selected JDBC supported database.

    MONGODB: The generated test data is written into MongoDB.

    Required
    Connection Name
    Note: This field is applicable only when you select JDBC or MONGODB as the data storage type.

    Enter the name of the JDBC or MONGODB connection.

    Required
    Output Format Specify the file format of the generated test data. Required
    Data File Location Specify the location for the output file. If the specified location is invalid, by default, the output file is saved in the HCL® OneTest Data server.
    Notes:
    • You can find the output file in the HCL® OneTest Data pod at the following location:

      /opt/hcl/hip-rest/output/<accountId>/<userID>/<projectId>/<schemaId>/<genMapPath>

    • This field is not applicable if you select the data storage type as JDBC or MONGODB.
    Optional
    Note: You can ignore the following property fields while you set up the integration of HCL UrbanCode Deploy with HCL® OneTest Data:
    • Working Directory
    • Post Processing Script
    • Precondition
    • Use Impersonation
  4. Create a resource and select the agent.
  5. Add the component that you created to the agent.
  6. Create an application.
  7. Create an environment from the Applications dashboard.
  8. Add the resource and the component that you created to the environment.
  9. Create a process for the application by clicking the Processes tab from the Applications dashboard.

    The page of the application process is displayed.

  10. Click the component process that you created in step 3 from the Component Process Steps on the left navigation pane and drag it into the design area.
  11. Click Save.
  12. Go to the Applications dashboard, and then click Request Process for the environment of the application process that you want to execute.

    The Run Process on environment name dialog box is displayed.

  13. Select the application process that you want to execute and click Submit.

    The HCL UrbanCode Deploy dashboard shows the progress of the application process request to generate the test data.

Result

You have successfully generated the test data by using the HCL® OneTest Data UCD Plugin for HCL® OneTest Data.

You can view the completed request process with the status displayed as Success or Failed.
Note:

If the test data generation request fails, you can view the logs of the process. See Viewing the UrbanCode Deploy logs

What to do next

After the successful completion of process, you can perform the following tasks:
  • If you selected FILE as a data storage type, the generated test data is downloaded in the local file system at the specified location.
  • If you selected JDBC as the data storage type, then you can use the generated test data from the database.
  • If you selected MONGODB as the data storage type, then you can use the generated test data from the database.