I am new to jmeter and i want to execute jmeter in non-gui fashion using java code.
When testing on the endpoints i would like to pass the "Send Parameters with the Request" via java code. So i have tried sending the data as follows
HTTPSampler httpSampler = new HTTPSampler();
httpSampler.setProtocol("http");
httpSampler.setDomain(hostip);
httpSampler.setPort(8080);
httpSampler.setPath(endpointpath);
httpSampler.setMethod("POST");
HTTPArgument httpArgument = new HTTPArgument();
httpArgument.setValue("[{ \"firstname\": "", \"name\": \"Venkat\"}]");
No Error came. The request was not added to the DB
Can some one suggest and provide a sample code to add the post request body using java?