jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From igora88 <mykytynigo...@gmail.com>
Subject How to generate and save to file SummaryReport or any other JMeter Report
Date Thu, 24 Jul 2014 16:24:32 GMT
Hello All.
I have created simple JMeter Test and i don't know how to generate and save
some kind of JMeter report(Summary Report, View results in Table e.t.c) to
some file.

My code looks like this:
package com.genesyslab.gks.ats.scenario.jmeter;

import com.genesyslab.gks.ats.scenario.BaseScenario;
import org.apache.jmeter.control.LoopController;
import org.apache.jmeter.engine.StandardJMeterEngine;
import org.apache.jmeter.protocol.http.sampler.HTTPSampler;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.testelement.TestPlan;
import org.apache.jmeter.threads.SetupThreadGroup;
import org.apache.jmeter.util.JMeterUtils;
import org.apache.jorphan.collections.HashTree;

/**
 * Created by IMykytyn on 7/24/2014.
 */
public class JMeterTest extends BaseScenario{

    @Override
    protected void scenario() throws Exception {
        // Engine
        StandardJMeterEngine jm = new StandardJMeterEngine();
        // jmeter.properties
        JMeterUtils.loadJMeterProperties("D:/Java
Tools/JMeter/apache-jmeter-2.11/apache-jmeter-2.11/bin/jmeter.properties");

        HashTree hashTree = new HashTree();

        // HTTP Sampler
        HTTPSampler httpSampler = new HTTPSampler();
        httpSampler.setDomain("192.168.67.98");
        httpSampler.setPort(8080);
        httpSampler.setPath("/gks-server");
        httpSampler.setMethod("GET");

        // Loop Controller
        TestElement loopCtrl = new LoopController();
        ((LoopController)loopCtrl).setLoops(1);
        ((LoopController)loopCtrl).addTestElement(httpSampler);
        ((LoopController)loopCtrl).setFirst(true);

        // Thread Group
        SetupThreadGroup threadGroup = new SetupThreadGroup();
        threadGroup.setNumThreads(1);
        threadGroup.setRampUp(1);
        threadGroup.setSamplerController((LoopController)loopCtrl);

        TestPlan testPlan = new TestPlan("MY TEST PLAN");
        testPlan.setTestPlanClasspath("D:/JMeterTestPlan/test.jmx");

        hashTree.add("testPlan", testPlan);
        hashTree.add("loopCtrl", loopCtrl);
        hashTree.add("threadGroup", threadGroup);
        hashTree.add("httpSampler", httpSampler);

        jm.configure(hashTree);

        //Run TEST
        jm.run();
    }
}

Please Help Me!
With Best Regards!



--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-generate-and-save-to-file-SummaryReport-or-any-other-JMeter-Report-tp5720668.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.

Mime
View raw message