In this blog we will see how to trigger LoadRunner Scenario from Jenkins
First we need to create a LR scenario and set the SLA configuration (mandatory) and result settings.
Using Command Line:
We have a provision in LR to run the scenario using Windows Command prompt by using Wlrun.exe and CLIControllerApp.exe based on the version you have.
Syntax:
LoadRunner\bin\Wlrun.exe -Run -TestPath C:\scenario.lrs -ResultName C:\ControllerResultPath\Res
LoadRunner\bin\CLIControllerApp.exe -TestPath C:\scenario.lrs -CollateAndAnalyze -ResultName C:\ControllerResultPath\Res
We will continue with Wlrun.exe example for now:
Create Jenkins projects and Go to Configure.
In Build section click on 'Add build step' dropdown and choose 'Execute Windows batch command'
Since Jenkins takes one command only, we use below syntax. Please use double quote ("") which your path contains space (white space).
cd "C:\Program Files (x86)\HPE\LoadRunner\bin\" & Wlrun.exe -Run -TestPath "C:\Users\OneDrive - USER\Scenario\Test_Scenarios.lrs" -ResultName "C:\Users\OneDrive - USER\Result\Res"
Apply and save and you will find results update once test is completed.
Open Issue:
Using Micro Focus Application Automation Tools plugin:
Firstly you need to install the plugin and then create the project.
Go to configure and then build section.
Click on 'Add build step' dropdown and choose 'Execute Micro Focus test from file System'
You need to update Test Field with path of your Load Runner scenario and Result Directory with Result path where you want to store it.
Click on LoadRunner Setting and you may change if need.
Click Save and Apply and Test the build.
You can configure Email for failed builds as well.
First we need to create a LR scenario and set the SLA configuration (mandatory) and result settings.
Using Command Line:
We have a provision in LR to run the scenario using Windows Command prompt by using Wlrun.exe and CLIControllerApp.exe based on the version you have.
Syntax:
LoadRunner\bin\Wlrun.exe -Run -TestPath C:\scenario.lrs -ResultName C:\ControllerResultPath\Res
LoadRunner\bin\CLIControllerApp.exe -TestPath C:\scenario.lrs -CollateAndAnalyze -ResultName C:\ControllerResultPath\Res
We will continue with Wlrun.exe example for now:
Create Jenkins projects and Go to Configure.
In Build section click on 'Add build step' dropdown and choose 'Execute Windows batch command'
Since Jenkins takes one command only, we use below syntax. Please use double quote ("") which your path contains space (white space).
cd "C:\Program Files (x86)\HPE\LoadRunner\bin\" & Wlrun.exe -Run -TestPath "C:\Users\OneDrive - USER\Scenario\Test_Scenarios.lrs" -ResultName "C:\Users\OneDrive - USER\Result\Res"
Apply and save and you will find results update once test is completed.
Open Issue:
- Controller wasn't launching but manually on Command prompt using same command it is launcing.
- Below command is working on Command prompt but not in jenkins:
Using Micro Focus Application Automation Tools plugin:
Firstly you need to install the plugin and then create the project.
Go to configure and then build section.
Click on 'Add build step' dropdown and choose 'Execute Micro Focus test from file System'
You need to update Test Field with path of your Load Runner scenario and Result Directory with Result path where you want to store it.
Click on LoadRunner Setting and you may change if need.
Click Save and Apply and Test the build.
You can configure Email for failed builds as well.
No comments:
Post a Comment