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

  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. Click Connections.
  5. Click New to create a new connection.

    The New Connection dialog box is displayed.

  6. Select MongoDB as a connection type and click Next.
  7. Enter the following properties of the connection in the Properties dialog box:
    1. Enter the host name of MongoDB in the Host field.
    2. Enter the server port number of the computer where MongoDB is running in the Port field.
    3. Enter the user name and password to access MongoDB.
  8. 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.
  9. 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.
  10. Click Next, and then provide a name to the established MongoDB connection.
  11. Click OK.

    You can see the name of the MongoDB connection under the Connections tab.

Results

You have successfully established the connection between HCL® OneTest Data and MongoDB.

What to do next

You must associate a schema with a database of MongoDB. See Associating a schema with MongoDB.