How to sequentially execute test method

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How to sequentially execute test method

Hello I've three methods doTransaction1(), doTransaction2() and doTransaction3().

i need to execute 50% Transaction1, 20% Transaction2 and 30% Transaction3.
Order of execution is Transaction1 -> Transaction2-> Transaction3
If Transaction2 or Transaction3 execute before Transaction1 then they'll fail.

While execution i'm not able to control sequence Transaction,  hence Transaction2 and Transaction3 are failing as Transaction1 is executing at last;

Below is my code :

class TestRunner {
        public static HTTPRequest request
    static GTest test1
    static GTest test2
    static GTest test3
    public static void beforeProcess() {
        test1 = new GTest(1,"test1_statistics")
        test2 = new GTest(2,"test2_statistics")
        test3 = new GTest(3,"test3_statistics")
        request = new HTTPRequest();
        HTTPPluginControl.getConnectionDefaults().timeout = 6000"before process.");

    public void beforeThread() {
        test1.record(this, "doTransaction1"); // Record current object’s doTransaction1 method into test1.
        test2.record(this, "doTransaction2"); // Record current object’s doTransaction2 method into test2.
        test3.record(this, "doTransaction3"); // Record current object’s doTransaction3 method into test3
        grinder.statistics.delayReports=true;"before thread.");
    public void doTransaction1(){
        // Do transactions here!!
    public void doTransaction2(){
        // Do another transactions here!!
    public void doTransaction3(){
        // Do another transactions here!!


2019-01-02 12:39:08,564 INFO  net.grinder.engine.process.JUnitThreadContextInitializer: two
2019-01-02 12:39:08,566 INFO  net.grinder.engine.process.JUnitThreadContextInitializer: one
2019-01-02 12:39:08,568 INFO  net.grinder.engine.process.JUnitThreadContextInitializer: three