Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Can we run multiple test batches via loadtest cli sequentially?

brawal
brawal Posts: 26

Scenario:
We need to run the loadtest for 1 hour in each batch. We have run the 8 hours batches in a single day one by one . Each on is one hour batch. Therefore, I want to run them all (8) batches sequential via command line loadtest cli. Is it possible? If yes, how do we do it, is there any example you guys can provide? . I am thinking to create 8 different loadtest projects and put them in a batch file and schedule it. Or can I call the same project @ 8 times with multiple sets of test data. In our case, data would be different in each batch.

It would be really appreciated if you can provide your incredible input.

Thanks

Comments

  • Sergei
    Sergei Posts: 34

    It looks like you have two questions in your post: first about running LoadTest projects in a sequence, the other about running a single LoadTest project with different sets of data.

    To answer your first question:

    If you are planning 8 LoadTest runs each executing a single LoadTest project for 1 hour, then I would recommend 8 separate LoadTest invocations with a single project rather than one LoadTest invocation that has 8 projects in a LoadTest script. Running each LoadTest project in a fresh instance of LoadTest will make your load test runs more stable.

    You can run your load tests in sequence from either a shell script or as sequential Jenkins (post) build steps:

    ./loadtest -cmd -run loadtestcmd-1
    ...
    ./loadtest -cmd -run loadtestcmd-8

    With regards to the second question:

    You can use the LoadTest -env command line option to run LoadTest with different environments. Most of the environment configuration logic takes place in the SOAtest project, while in LoadTest you can switch between environments. It is possible to use environment variables to switch between data sources, for details please see the following SOAtest documentation pages:

    https://docs.parasoft.com/display/SOA9106/_Configuring_for_Different_Environments

    particularly the Using Environment Variables in Tests and Tools section for configuring data sources.

    https://docs.parasoft.com/display/SOA910/Running+Tests+in+Different+Environments

    and search for “soa_env” for data source related details.

  • brawal
    brawal Posts: 26

    Thank you Sergei for your incredible input.

    I still want to be more clear what I am going to do :smile:

    • Created 1 Soatest project (Test1) which will have one data source (DT1)
    • Created 1 Loadtest project (LT1) for one(1) hour run
    • After run is finished, I need to change data source from DT1 to DT2 (in the server) and refresh the project multiple times and run it again against the DT2 ... so on .

    If i create the eight (8) separate loadtest projects using the Soatest Project (Test1), however, Test1 is associating with DataSource (DT1)

    How do I change the Data source for all the eight loadtest projects without creating eight separate SOAtest projects, which each one will be pointing to DT1, DT2, DT3 ...... so on...

    If I do eight SOAtest and Loadtest projects and can follow your instructions.

    In this case there will be maintenance efforts , If the change need to be made in one soatest project, then I need to make changes in all (8) soatest projects...

    If I need to change the delay in one loadtest, then need to change in all the loadtest projects manually.

    Is there a better way to maintain the projects if changes required ?

  • Sergei
    Sergei Posts: 34

    Maybe I did not quite get my point across in the previous post, so let me rephrase.

    If you would like to use a single SOAtest project and run it with different data sets, I recommend you look at the following docs page that explains how to configure data sources so that you can switch them by switching the environment variables:

    https://docs.parasoft.com/display/SOA9106/_Configuring_for_Different_Environments

    In the Using Environment Variables in Tests and Tools section look for the following line in an example of how to make data sources depend on environment variables:

    ${soa_env:Variable}/calc_values.xlsx

    If you configure your SOAtest project data sources this way you are going to have one SOAtest project which will use different data sources depending on which environment is active.

    Same with the Load Test - you can too switch environments with the Load Test -env command line option, so you can use one Load Test project, but you will run it (8 times) with different environment variables which will cause Load Test to use data specific for that environment.