1

I want to run my scenario outline examples more than once with different set of data and data is dynamic for examples.

For eg: I am having java List say L which contains values of country like USA, INDIA UK and so on.(which will generated dynamically) and I want to run my examples with set of data for eg:

Examples:
|Country| State| Region|
|USA    | ABC | DEF    |
|USA    | GHI | JKL    |
|USA    | MNO | PQR    |

Now I want above Examples will run for first USA and then for INDIA and so on(as per data in list)

I tried to make it run by using following

public class ABC {
    @test
    public void run() throws Throwable {
        for(String s: L){
            net.serenitybdd.cucumber.cli.Main.main(new String[] { "-g", "Path of Step Defs","Path of feature file" });
        }
    }
}

and running above class as "clean verify -Dit.test=Abc.java"

It is running fine for first data from list and report generated successfully, but it is not running for rest of data. Please suggest how can I achieve above part.

Thanks in advance.

daedsidog
  • 1,732
  • 2
  • 17
  • 36

0 Answers0