Reputation: 61
Just to give you a context of what i want to achieve :
My functional test team have a java library, which comprises of HTTP calls, based out of REST architecture. I basically want to re-use the jars and invoke methods at higher concurrency. I just wanted to know how this can be achieved using JMeter's JavaSampler?
Example : Lets say I want to do a 100 user login and log-out test, and my jar provides me with the login and logout functionality, then how would my test look like? Any pointers around this would be very helpful for me to get started.
Upvotes: 1
Views: 10215
Reputation: 907
Can add the Jar file in the Test Plan
Check this link. which has step by step detail for using an external jar
Upvotes: -1
Reputation: 139
This is working for me with BeanShell post-processors (jmeter 3.2):
I am then able to reference the relevant classes in my script.
Upvotes: 1
Reputation: 168092
Option 1 - Using Groovy
groovy
as a language and make sure Cache compiled script if available
box is checkedOption 2 - Using Java Request
Create your own class implementing JavaSamplerClient interface and create your own overrides of the setupTest()
, getDefaultParameters
and especially runTest()
methods. You can see the following existing classes for reference:
Option 3 - Using jmh
JMH stands for Java Microbenchmark Harness so if you just need to measure method execution timings you can do it even without JMeter, check out Getting Started With JMH guide for more information.
Upvotes: 3
Reputation: 3409
Place you jar files in the lib
folder inside your jmeter folder.
restart and just try importing the corresponding classes.
Upvotes: 2