Friday 9 March 2018

how to integrate HP Loadrunner with Jenkins

Jenkins HP Application Automation Tools add-in
I knew that this Jenkins plugin worked with ALM and QTP/UFT but it was new to me that is also works with HP LoadRunner 11.52. This add-in allows you to enable a trigger for a LoadRunner Scenarios as a build step, and its results will show up in the Jenkins results dashboard.
Jenkins Setup
To start using the HP Application Automation Tools with LoadRunner you need to do the following setup work in Jenkins:
First install the Jenkins HP Application Automation Tools add-in
1) In your Jenkins instance, navigate to the Manage Jenkins area and click on the Manage Plugins link.
 wAAACwAAAAAAQABAEACAkQBADs
2) Click on the Available Tab.
3) Under the Filter text box, enter HP.
4) Under the Available tab, look for the name HP Application Automation Tools.
 wAAACwAAAAAAQABAEACAkQBADs
5) Click on the Install checkbox and click on the Download Now and Install After
Restart button.
Configure Jenkins
Once the add-in is installed and you have restarted Jenkins:
  1. Click on the Jenkins>New Job menu option. 
  2. Enter a Job Name – I named my RunLoadrunner – and click on the Build a free-style software project option. Click OK
     wAAACwAAAAAAQABAEACAkQBADs
  3. Under the your new project’s configuration scroll down to the Build section and click on the Add build step and click on the Execute HP tests from file system option
     wAAACwAAAAAAQABAEACAkQBADs
  4. Under Build you should now have an option for LoadRunner-Specific Settings.. – Click on it.
     wAAACwAAAAAAQABAEACAkQBADs
  5. Under the LoadRunner Settings enter the following:
  • Controller Polling Interval – the time to poll the LR Controller for your scenario status
  • Scenario Execution Timeout – this is the total time for the execution of all your scenarios
  • Errors to Ignore – – during the run you can tell which errors to ignore
 wAAACwAAAAAAQABAEACAkQBADs
  1. Under the Build/Tests section enter the path to your LoadRunner scenario. For example my scenario named JnekinsDebug.lrs lives under my D:\myLoadRuner directory. So my Tests field =D:\myLoadRunner
     wAAACwAAAAAAQABAEACAkQBADs
  2. Under the Post-build Actions section click on the Add post-build action and select Publish HP tests result
     wAAACwAAAAAAQABAEACAkQBADs
  3. Apply and Save your settings
  4. Run the LR job you just created like you would any standard Jenkins job
Set LoadRunner Scenario SLA
One thing to watch out for is to make sure that your scenario has a SLA defined. If it does not your Jenkins job will fail with a message similar to this:
 wAAACwAAAAAAQABAEACAkQBADs
To fix just go into your Scenario in the LoadRunner Controller and add a SLA:
 wAAACwAAAAAAQABAEACAkQBADs
LR Jenkins CI Wrap-up
That is how you integrate LoadRunner with Jenkins. Hope it helps. Let me know if I missed anything.

Saturday 3 March 2018

Ajax TruClient End events

Ajax truclient end event:


During the second script replay, TruClient confirm the Automatic End Event and will assigned any step's End Event that had been reset to Automatic: Not Set Yet.
If TruClient is unable to assign an automatic End Event during replay, usually due to a network timeout, a warning message will inform you that the End Event has been reset to Automatic: Not Set Yet. Replay the script to automatically assign the End Event or assign the End Event manually.

identifying the end event


Before enhancing an Ajax TruClient script, replay the script to synchronize the steps. During the first script replay, TruClient will try to automatically identify the End Event for each step.
An End Event can be one of the following:
• Action Started - Dispatched when the action defined in the step is starting. For steps with objects (i.e. most steps) it will occur right after the object has been successfully found in the application.
  
 • Action Completed - Dispatched when the action defined in the step is completed. 
 
 • Step network completed - Dispatched when the network activity associated with the step is completed. Ajax TruClient waits a small amount of time in order to make sure that no new requests are created after all other requests have ended. The threshold is configurable via the script Runtime Settings (default is 150ms). 
 
 • DOM Content Loaded - Corresponds to the "domcontentloaded" event and is dispatched when parsing of the page is completed. The event will be dispatched only if the step's action has triggered a page navigation.
 
 • Document Loaded - Corresponds to the standard "load" event and is dispatched when the page is completely loaded, including frames/images/stylesheets. The event will be dispatched only if the step's action has triggered a page navigation. 
 
 • Dialog opened - A modal dialog has opened. The dialog can either be opened from JavaScript (using the alert/confirm/prompt functions) or is an authentication dialog.

Important links on Ajax truclient :

http://claudihome.com/html/LR/WebHelp/Content/VuGen/TruClient/125700_ajax_TC_functions.htm

https://community.hpe.com/t5/LoadRunner-Practitioners-Forum/VUGen-Ajax-TruClient-Evaluate-JS-on-Object/td-p/2392313

https://community.hpe.com/hpeb/attachments/hpeb/sws-LoadRunner_SF/6769/1/LoadRunner11.00_AjaxTruClient_TipsTricks.pdf