4
votes

These are the steps that i follow to do JMeter with Maven Project integration.

1) Recorded a series of steps using JMeter GUI and copied the .jmx file to the maven project under test/jmeter folder 2) I can able to run the project and it is working fine as expected.

My Problem is I want to connect to the mongo database and delete the record from the table, before executing the jmx file.

How to connect MongoDB using Jmeter.

Can any one please help me on this.

1
Please look also at Can JMeter be used to delete records from a database? it is about tear down, but ... setup is not far from that config wise I guess. In most cases I may click sometime to have a working JMX but then I load it into an editor and ... that code stripped down would be a godd addition to the question I guess. - Dilettant

1 Answers

6
votes

You can use the following Test Elements:

in order to establish MongoDB connection and execute an arbitrary script. See How to Load Test MongoDB with JMeter guide for details on using MongoDB test elements.

If you recently upgraded to JMeter 3.0 the elements might be hidden. In order to get them back just add the next line to user.properties file:

not_in_menu=

and restart JMeter to pick the change up.