Interview Questions, Answers and Tutorials

Run LoadRunner Controller from the command line

Run LoadRunner Controller from the command line

You can open the LoadRunner Controller scenario with:

LoadRunnerbinWlrun.exe -Run -TestPath scenario. lrs -ResultName res_folder
 
For example: 
 
 
(note: click the image to enlarge it)
 
As a result of the above command, LoadRunner Controller: 
 
  • starts
  • opens Controller scenario
  • executes it
  • saves results to folder ‘C:TempLR_Resresult_0’
After that, the Controller finishes working and closes. Please, see files from created ‘C:TempLR_Resresult_0’ folder:
 
 
Tips: As you see, there is a LoadRunner Result file (result_0.lrr). You can pass it automatically to LoadRunner Analysis for further processing.

Actually, Wlrun.exe can have several settings. There are their descriptions from HP LoadRunner Controller User’s Guide (© HP/Mercury Interactive):
 
TestPath Path to the scenario.
For example, C:LoadRunnerscenarioScenario.lrs
If the path includes blank spaces, use quotation marks.
Run Runs the scenario, dumps all output messages into res_diroutput.txt, and closes Controller
InvokeAnalysis Instructs LoadRunner to invoke Analysis upon scenario termination. If this argument is not specified, LoadRunner uses the scenario default setting.
ResultName Full results path. For example, “C:TempRes_01”
ResultCleanName Results name. For example, “Res_01”
ResultLocation Results directory. For example, “C:/> Temp”
 
Note: ResultName (full path) = ResultLocation (directory) + ResultCleanName (name)
 
Well, let’s see different variants of how to open and run the LoadRunner Controller script: 
 
1. Open LoadRunner Controller:
  Wlrun.exe
 
2. Open LoadRunner Controller scenario ‘scenario.lrs’ and do not execute it: 

  Wlrun.exe -TestPath scenario.lrs
 
3. Open LoadRunner Controller scenario ‘scenario.lrs’, execute it, and save results to default folder (‘C:/>Documents and Settingsuser_loginLocal SettingsTempres’): 

  Wlrun.exe -Run -TestPath scenario.lrs
 
4. Open LoadRunner Controller scenario ‘scenario.lrs’, execute it, and save results to ‘res_folder’ folder:
 
 Wlrun.exe -Run -TestPath scenario.lrs -ResultName res_folder

5. Open LoadRunner Controller scenario ‘scenario.lrs’, execute it, save results to ‘res_folder’ folder, and after that start Analysis on created results with default template: 

Wlrun.exe -Run -TestPath scenario.lrs -ResultName res_folder – InvokeAnalysis
 
And please see a more complex example for dessert 🙂 
 
6. Open LoadRunner Controller scenario ‘scenario.lrs’, execute it, save results to ‘res_folder’ folder, and after that start Analysis on created results with default template. Repeat all these steps 10 times: 
 
set LR_HOME=C:Program FilesMercuryLoadRunner
for /L %%i in (1,1,10) do “%LR_HOME%binWlrun.exe” -Run -TestPath “%LR_HOME%scenariomemory_leak_crash.lrs”
-ResultName C:/>TempLR_Resresult%%i 
 
Result is: 
 
 
Well, where to use execution from a command line?
It can be very useful in some cases when you plan to:
  • run LoadRunner Controller and pass its results to LoadRunner Analysis
  • run LoadRunner scripts by schedule

3 thoughts on “Run LoadRunner Controller from the command line

Comments are closed.