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
- Select your project in HCL OneTest™ Server and go to the Data Fabrication page.
- Select the schema that you associated with the database from the Schemas tab.
- Select the group type of the schema for which you want to generate the test data.
-
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. - Select the Connection option.
-
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.
- 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
-
Connection URL that includes details of host name and port number.
-
Name of the collection.
-
Database name with which the schema is associated.
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.