This feature can decrease tester's manual efforts and thereby to increase your effectiveness and performance.
You can open LoadRunner Controller scenario with:
LoadRunner\bin\Wlrun.exe -Run -TestPath scenario.lrs -ResultName res_folder
For example:
As a result of above command, LoadRunner Controller:
- starts
- opens Controller scenario
- executes it
- saves results to folder 'C:\Temp\LR_Res\result_0'
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.
Refer for detailed information: Custom HTML report in LoadRunner Analysis from command line.
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:\LoadRunner\scenario\Scenario.lrs If the path includes blank spaces, use quotation marks. |
Run | Runs the scenario, dumps all output messages into res_dir\output.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:\Temp\Res_01" |
ResultCleanName | Results name. For example, "Res_01" |
ResultLocation | Results directory. For example, "C:\Temp" |
Well, let's see different variants of how to open and run LoadRunner Controller script:
Open LoadRunner Controller:
Wlrun.exe
Open LoadRunner Controller scenario 'scenario.lrs' and do not execute it:
Wlrun.exe -TestPath scenario.lrs
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
Open LoadRunner Controller scenario 'scenario.lrs', execute it, and save results to 'res_folder' folder:
Wlrun.exe -Run -TestPath scenario.lrs -ResultName res_folder
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 :)
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: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
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
Thank you, dear readers.
Any questions and comments? Welcome :)
--
Dmitry
Related articles:
- How to automatically create custom HTML report in LoadRunner Analysis from command line?
- Using parameters in Loadrunner VuGen script
- Using Correlation in LoadRunner scripts - visual tutorial
- All LoadRunner visual tutorials
20 comments:
Hi Dimtry,
I am new to LR. I learning LR. Could you please guide me what step do we need to take before recoding Web applilcations. For Eg., What the Tools ->Internet Options -> Connections -> ..
What do we need to check here for recording an Intranet apps? Proxy settings?
2Srikanth:
Usually, you can set the same Recording Internet connection options as for Internet Explorer.
Hi Dmitry Sir
I want to know about Performance Test Plan Document and who to create it, what are the objects in the test plan, what are the things we need to collect (requirement) from the client? How to distribute load between tasks.
and
For example I am having 100 Vuser license. Can I run more then 100 V users? Any possibility. (Because I face this question every time )
If you post it I will be thank full to you.
My email id is saikiran.ganti@gmail.com
Hi Dmitry,
Could you explain us explain on bandwidth throttling in LR.
Suppose I need simulate the load test with real world internet network bandwidth like 100 KBPS or 200 KBPS between the client and server.
How to simulate using different network speeds in Loadrunner.
An article on this would be really better.
Vasanth.
Hi,
This is kanda.
I have tried to run controller from Cmdprompt as by your comments "C:\Programfiles\Mercury\Loadrunner\bin>wlrun.exe -Run -Testpath scenario.lrs -Resultname res_fol -Invokeanalysis" when I tried,it invokes controller,but its not running the scenario,not invoking the analysis.I have windows XP Proffesional.
So can u give me idea how to check it
2Kanda:
You should specify the full path to your scenario.
For example:
-Testpath C:\folder\scenario.lrs
Hi Dimtry!!
I want to program with scripts by Java and convert Web Vuser Scripts into Java. Could you please tell me what step i need to do.
Thank you very much.
2BAD^-^BOY:
Have you already Web scripts in C?
Did you modified/edited them or not?
Why do you plan to convert them into Java?
No, i have recorded a Web script by VuGen. And my teacher wants me: convert it to Java script.
No, i have recorded a Web script by VuGen. And my teacher wants me: convert it into Java script.
2BAD^-^BOY:
Please, read Document #12739 (How to convert a C-Web Vuser script to a Java Vuser script) from HP Knowledge Base.
Hi Dmitry,
Could u please explain what is the difference in running the scripts on the LR Controller in scenario mode and group mode? when we go for scenario mode and when for group mode?
hi dimtry,
can u explain abt how to monitor weblogic resources
I've been given the task of automating the testing procedure as much as possible, which will necessarily mean running the Controller from the command line. I'm unable to understand the return codes (as indicated by %ERRORLEVEL%) that I'm seeing (eg. 2, even with successful completion). Any assistance would be appreciated.
2Anonymous,
This is explained in LR Help.
I do not want to copy-paste it.
2Anonymous,
I can't 'cause I didn't work with weblogic.
2Anonymous (from August 13, 2008 4:53 AM),
So, what is your question?
HI Sir,
This is Maheshwar.
The way explain things are very good. We could understand very easily and in my projects as well.Thanks
Regards
Maheshwar S
Hi Dmitriy,
In my scenario I have several load generator machines, is there any way to connect them before exection using the batch file previosly shown?
Thanks in advance.
Hello Dmitry,
Likewise, I am unable to understand the return codes (as indicated by %ERRORLEVEL%). Would you please provide the name of the help file (chm or pdf) that the information is contained in... I cannot find it anywhere. We have LR v9.10.
Post a Comment