Inserting the generated test data in a database

After you associate a schema with a database of MongoDB, you can generate the test data and insert the generated test data directly in the database by using HCL® OneTest Data.

Before you begin

You must have associated the schema with MongoDB. See Associating a schema with MongoDB.

Procedure

  1. Log in to HCL OneTest Server and open the team space that contains your project.
  2. Open your project.
    The Overview page is displayed.
  3. Click Author > Data Fabrication.
    The Data Fabrication page is displayed.
  4. Select the schema that you associated with the database from the Schemas tab.
  5. Select the group type of the schema for which you want to generate the test data.
  6. Click the menu of the selected group type, and then click Generate Data.

    You can view the list of all item types associated with the selected group type in the structure view.

    The Generate Data dialog box is displayed.
  7. Select the Connection option.
  8. Select the MongoDB connection name that you established from the Connections drop-down list.
    Note:

    When you select MongoDB to insert the generated test data, you can generate only one record of test data at a time.

  9. Provide a value for Numeric Seed Value, and then click OK.

Results

You have successfully generated and inserted the test data in MongoDB.

What to do next

You can click the Jobs tab to view the status of the job. When you hover over the status of the job, you can view the following details in the tooltip:
  • Connection URL that includes details of host name and port number.

  • Name of the collection.

  • Database name with which the schema is associated.

Important:

You cannot download the generated test data from the Jobs page because the test data is written directly in the MongoDB database and the generated test data is not available in HCL® OneTest Data.

You must log in to the database to view the generated test data.