Implement sequential execution of multiple scenes LoadRunner
The scenario assumes that there are 3 different
Testscenarios, including concurrent logins, core business, reliability tests, and 3 scenarios with sequential execution. Because the daytime test machine is otherwise useful, it can only be carried out at night.
Performance Testing, our expectation is to be able to set the test scene to run automatically after the night, the next day we come back to see the test results? The answer is yes, it can be implemented in two ways.
first, relatively simple.Take advantage of the function of the group within the LR controller. Create a new scene to add 3 scripts, in the edit Schedule select "Schedule by group" Way, in StartTime set 3 scripts run in the order of "Start when Group xxx finished", and in the " Scenario start time to set the running start times of the scene at night. After the scheduled execution of the scene, click the Startscenario button, a countdown window will appear, so that at a fixed time, the test scene of the 3 scripts will be obediently in accordance with the set order of test. Note that if you do not click the Startscenario button to activate the test, it is not actually tested. (Thanks to Athenst Friend's reminder, ^_^)
the second kind, more flexibleWe extend the scenario a little, assuming that 1 or 3 scenes have only one test script, while the core business scenario consists of data entry, data query, data escalation 3 scripts, and 3 scenarios still need to be tested sequentially. At this point, if the first way, because the 2nd scene has 3 scripts, so the start time of the third script is a problem. Since each script in the controller corresponds to a group and GroupName cannot be duplicated, the StartTime "Start when group finished" in the third scene can only select a group in the second scene. Instead of the second scenario, 3 scripts are completed before they can be reached. At this point, it can be done in the command line way. First create and set up 3 test scenarios, and then create a batch program to call these 3 scenarios in sequence to test, and finally through
WindowsTimer task to set the execution time of the batch. The batch processing example 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 is a more flexible approach, but it is important to note that in result settings, set "Automatically create a results directory for each scenario execution" to avoid overwriting the previous test results. In addition, if you want to do a script 50, 100, 150 ... etc. the test of increasing number of users can also be implemented using the above method, but it is important to distinguish the transaction name area for analysis.
Implement sequential execution of multiple scenes LoadRunner