Establishing a MongoDB connection with HCL OneTest Data
You must establish a connection between HCL OneTest™ Data and MongoDB to associate a schema with the database.
Before you begin
You must have completed the following tasks:
- Created or imported a schema in the HCL OneTest Data project.
- Installed MongoDB on your computer and the MongoDB instance must be ready to connect. For more information, refer to Install MongoDB.
- Created a database in MongoDB. For more information, refer to Database Methods.
Procedure
- Select your project in HCL OneTest™ Server and go to the Data Fabrication page.
- Click Connections.
-
Click New to create a new connection.
The New Connection dialog box is displayed.
- Select MongoDB as a connection type and click Next.
-
Enter the following properties of the connection in the
Properties dialog box:
- Enter the host name of MongoDB in the Host field.
- Enter the server port number of the computer where MongoDB is running in the Port field.
- Enter the user name and password to access MongoDB.
-
Click Test to verify whether the connection is established
successfully.
Note: If the connection fails to establish, it can be because of any one of the following reasons:
- Unreachable database.
- Missing database.
- Incorrect host name and port number.
- Click Fetch to upload all the databases available in the configured MongoDB in the Database drop-down list, and then select the database that you want to use to write the generated test data.
- Click Next, and then provide a name to the established MongoDB connection.
-
Click OK.
You can see the name of the MongoDB connection under the Connections tab.
Results
What to do next
You must associate a schema with a database of MongoDB. See Associating a schema with MongoDB.