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. Select your project in HCL OneTest Server and go to the Data Fabrication page.
  2. Select the schema that you associated with the database from the Schemas tab.
  3. Select the group type of the schema for which you want to generate the test data.
  4. 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.
  5. Select the Connection option.
  6. 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.

  7. 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.