Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Serial execution and timing execution of multiple scenarios in loadrunner

Shulou Source: shulou.com Published: 2022-06-03 03:44:51 10月03日 Update

Method 1:

Since scripts are executed serially, it is necessary to use multiple scripts in the scene design. Note that Schedule by in Scenario Schedule needs to be set to Group mode. Then according to the actual need to set the Schedule of each script in turn. To calculate the entire execution time of each script in advance, it is convenient to define the start time of subsequent scripts (set Start Group).

Method 2:

Use timed tasks to perform:

First create and set up the test scenarios to run, then create a batch program to call these scenarios in sequence for testing, and finally set the execution time of batch processing through Windows timed tasks.

Write a batch file

An example batch process is as follows:

cls

SET M_ROOT="D:\Program Files\MI\Mercury LoadRunner\bin\"

%M_ROOT%\wlrun.exe -TestPath "D:\Program Files\MI\Mercury LoadRunner\scenario\Test\TestScen_1.lrs" -Run

%M_ROOT%\wlrun.exe -TestPath "D:\Program Files\MI\Mercury LoadRunner\scenario\Test\TestScen_2.lrs" -Run

%M_ROOT%\wlrun.exe -TestPath "D:\Program Files\MI\Mercury LoadRunner\scenario\Test\TestScen_3.lrs" -Run

This method is flexible, but you need to pay attention to setting "Automatically create a results directory for each scenario execution" in Result Settings, so as not to overwrite the previous test results.

Additional:

If you want to do timed execution of scripts, you can actually do it in multiple scenarios.

1. Add Scenario A to test

2. Add a scenario B unrelated to the test. In this scenario, set your own thinking time. Try to design it to last until you want to run the script.

3. Set script serial execution, execute B first, how long after execution (this time long is defined by yourself, basically after the end of this time is to execute the scene A that you want to execute)

4. Of course, the most direct way is to use timed tasks to execute their own scenarios, so that there is no need to use multiple scenarios.

Tags: Scenario script time test task that is way method duration design sequence method multiple fixed point actual as much as possible necessity file time period pattern Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Microsoft macOS NVidia Huawei