An API that give access to full Jmeter feature as code, All designed object in GUI can be written as code.
If you are new with Jmeter as code, try examples project and see documentation website.
TestPlanWrappertestPlan = TestPlanWrapper.builder()
.addThread(ThreadGroupWrapper.builder()
.addSampler(
HTTPSamplerProxyWrapper.builder()
.withName("Home")
.withDomain("https://github.com")
.withProtocol("https")
.withPath("/anasoid")
.build())
.build())
.build();
ApplicationTestapplicationTest = newApplicationTest(testPlanWrapper);
applicationTest.run();
//ORapplicationTest.toJmx(newFile("mytest.jmx"));TestPlanWrappertestPlan = TestPlanWrapper.builder()
.addThread(ThreadGroupWrapper.builder()
.addSampler(newHomePage())
.build())
.build();
ApplicationTestapplicationTest = newApplicationTest(testPlanWrapper);
applicationTest.run();
//ORapplicationTest.toJmx(newFile("mytest.jmx"));
classHomePageextendsAbstractJmcTemplate<HTTPSamplerProxyWrapper, HTTPSamplerProxyWrapperBuilder<?, ?>> {
@OverrideprotectedvoidprepareBuilder(HTTPSamplerProxyWrapperBuilder<?, ?> builder) {
super.prepareBuilder(builder);
builder.withName("Home")
.withDomain("https://github.com")
.withProtocol("https")
.withPath("/anasoid");
}
@OverrideprotectedJmcWrapperBuilder<?> init() {
returnHTTPSamplerProxyWrapper.builder();
}
}