Friday, March 1, 2024

How to execute custome jar file in JMeter

1). Create your jar file using Eclipse.

2). Because Eclipse will allow you to convert a single java method (without any main method) to a jar file.

  • Package name  : tempDBUpdate
  • Class name : update
  • Method name : updatedb

All my libraries are inside reference Libraries folder.


3). Convert to a jar file by right-click on your project → select Export → Select JAR file under java folder.


4). Move the newly generated jar file to JMeter \apache-jmeter-5.6.3\apache-jmeter-5.6.3\lib\ext folder.

5). From open JMeter and add a JSR223 Sampler

6). Set language as groovy

7). Import the jar file as for the line number 1.

8). Create an object of the class as for the line 3.

9). Call the method.



Dont use Main method to call in J Meter as it will give errors and it will not call the actual Main method implementations.

Don't use IntelliJ to cremate jar files as IntelliJ only allow Main method to convert to jar file.





No comments:

Post a Comment