It is quite easy to test API or Website using JMeter but you may come across situation when you have to load test java class directly. This post described how a java class can be load tested. We will write a java program and use JMeter Java Sampler to load test it - Set up a maven selenium project. If you are new to java and maven then you may like to check my java tutorials Add following dependencies to your maven project (find out latest versions by searching https://search.maven.org/) - < dependency > < groupId > org.apache.jmeter </ groupId > < artifactId > ApacheJMeter_core </ artifactId > < version > 3.1 </ version > </ dependency > < dependency > < groupId > org.apache.jmeter </ groupId > < artifactId > ApacheJMeter_java </ artifactId > < version > 3.0 </ version > </ dependency > Let's write a java program to add numbers - public class AddNumbers