Run LoadRunner Controller from command line?

You can open LoadRunner Controller scenario with:

LoadRunner\bin\Wlrun.exe -Run -TestPath scenario.lrs -ResultName res_folder


For example: 


(note: click the image to enlarge it)

As a result of above command, LoadRunner Controller: 

  • starts
  • opens Controller scenario
  • executes it
  • saves results to folder 'C:\Temp\LR_Res\result_0'
After that, Controller finishes working and closes.
Please, see files from created 'C:\Temp\LR_Res\result_0' folder:



Tips: As you see, there is 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):

TestPathPath to the scenario.
For example, C:\LoadRunner\scenario\Scenario.lrs
If the path includes blank spaces, use quotation marks.
RunRuns the scenario, dumps all output messages into res_dir\output.txt and closes Controller
InvokeAnalysisInstructs LoadRunner to invoke Analysis upon scenario termination. If this argument is not specified, LoadRunner uses the scenario default setting.
ResultNameFull results path. For example, "C:\Temp\Res_01"
ResultCleanNameResults name. For example, "Res_01"
ResultLocationResults 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 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 Settings\user_login\Local Settings\Temp\res'): 

  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 more complex example for desert :) 

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 Files\Mercury\LoadRunner
 for /L %%i in (1,1,10) do "%LR_HOME%\bin\Wlrun.exe" -Run -TestPath "%LR_HOME%\scenario\memory_leak_crash.lrs"
 -ResultName C:\Temp\LR_Res\result%%i 

Result is: 


Well, where to use execution from a command line?
It can be very useful in some cases, when you plain to:

  • run LoadRunner Controller and pass its results to LoadRunner Analysis
  • run LoadRunner scripts by schedule

3 comments:

Brave Technologies said...

Thank you for this valuable information. The information you shared is very interesting. Get your business to the next level in simple steps.
cloud erp in chennai | cloud erp solutions in chennai

SEO Training in Surat – SEO Training Institute in surat said...

Thank You Dear for you have inform me on Run Load Runner Controller from command line. i don't know for this information

AUSTERO said...

Very helpful information about LoadRunner. Thanks for sharing.

Best Mobility Services | Austere Technologies