Load Runner

Running UFT GUI Tests in Load Runner

LoadRunner can integrate UFT tests into a load testing scenario in the form of GUI Vuser scripts. These tests, that have already been designed and debugged in UFT can be used as the basis of your load test.

Now one can use use UFT test scripts for load testing using LoadRunner , we can run UFT scripts using controller or Performance center.

This post explains why to use UFT scripts in Load Runner, how to set up the Performance Center or LoadRunner integration with UFT ,prerequisites and guidelines for UFT scripting for load runner.

Why to use UFT scripts in Load Runner?

  • To check how your application’s functionality is affected by heavy load
  • To measure the response time that a typical user experiences on the client side while your application is under load (end-to-end response time)
  • GUI Vuser script runs on your screen during the test, enabling you to watch the actual steps executed by the Vuser in real time.
  • Complex tests and applications where recording is not possible by using load runner.
  • For UI load testing

UFT scripting guidelines for Load Runner

When creating test scripts in Unified Functional Testing (UFT) that are going to be used as GUI Vuser scripts in a LoadRunner Professional testing scenario, you need to follow certain guidelines to ensure smooth integration of the script.

Consider below guidelines when designing tests for use with LoadRunner Professional:

  • The UFT tests you use with LoadRunner Professional should be simple tests, designed to pinpoint specific operations.
  • LoadRunner Professional cannot run nested action iterations.
  • Do not include references to external actions or other external resources, such as an external Data Table file, environment variable file, shared object repositories, and so forth.
  • Include transactions in your UFT test since LoadRunner Professional only provides performance information for data that is included within a transaction.
  • Use Services.StartTransaction and Services.EndTransaction to measure the transaction in UFT
  • Use Services.ThinkTime  to insert the thinktime between the transactions.
  • Put condition for the pass and fail transaction.
  • For log reporting use Services.LogMessage to log the errors or msgs in load runner.
  • Use Services.AddWastedTime method to report the time spent performing operations that are not relevant to the actual process you are testing
  • UFT checkpoints are not recognized by Performance Center. . Therefore, if you want to check the PASS/FAIL criteria of checkpoints in Performance Center as well, you need to surround them with transactions.

UFT script syntax for Load Runner

Services.StartTransaction "<Transaction_Name_1>"
'...........................................................................
'..........................UFT code to perform the actions..................
'...........................................................................
'......................Condition for transaction/step/action................
If Condition Then
	Services.EndTransaction "<Transaction_Name_1>",Pass
Else
	Services.EndTransaction "<Transaction_Name_1>",Fail
	Services.LogMessage "<Error_Msg>",OutputMsg  
End If

Services.ThinkTime 10

Services.StartTransaction "<Transaction_Name_2>"
'...........................................................................
'..........................UFT code to perform the actions..................
'...........................................................................
'......................Condition for transaction/step/action................
If Condition Then
	Services.EndTransaction "<Transaction_Name_2>",Pass
Else
	Services.EndTransaction "<Transaction_Name_2>",Fail
	Services.LogMessage "<Error_Msg>",OutputMsg  
End If

Services.ThinkTime 10

Services.StartTransaction "<Transaction_Name_n>"
'...........................................................................
'..........................UFT code to perform the actions..................
'...........................................................................
'......................Condition for transaction/step/action................
If Condition Then
	Services.EndTransaction "<Transaction_Name_n>",Pass
Else
	Services.EndTransaction "<Transaction_Name_n>",Fail
	Services.LogMessage "<Error_Msg>",OutputMsg  	
End If
'Services.LogMessage 
'OutputMsg (6) - send the message to the standard Vuser log 
'ErrorMsg (7) - set the test status to Fail and consider this an error message.
'StatusMsg(51) - send the message to the Vuser Status field.

Prerequisite

  • To run UFT script itself you have to have UFT license – seat or concurrent license
  • To run UFT script from LoadRunner you have to have “GUI” Vuser LoadRunner license.
  • One machine required per GUI Vuser thats means you can only run one test per machine.(But you can evade this restriction – use Terminal server or Citrix server. They allow to create several virtual desktops. And you will be able to execute several QTP scripts on one physical computer.)
  • UFT should be installed on all Load Generator machines.

Note: Each UFT instance should have its license. If you use concurrent licenses and plan execute 10 UFT scripts, then each UFT will require license – You should provide 10 seat or concurrent licenses.

How to run in Load Runner’s Controller

  1. Launch the load runner controller and select “New ” from file menu.
  2. Click “Browse” to select the UFT test.
  3. Select “QuickTest Tests” or “GUI Scripts” (for tests created in the SAP environment) in the Files of type box
  4. Now do the settings in scenario and run the test.

How to run in Performance Center?

Connect your UFT with the same ALM instance as Performance Center (this can be done from the ALM tab in UFT). Save the UFT test in ALM.       

  1. Create a Performance Center test, and assign the UFT test to it.
  2. Set the number of Vusers per group that will run the GUI script.
    • Typically, this number should be set to 1, because UFT does not support running multiple instances on the same Windows session.
    • However, if you want to run multiple Vusers on the same load generator, you can do so by using the LoadRunner-Terminal Services integration. This enables you to create multiple Windows sessions on the same load generators, and as a result, run one UFT GUI Vuser on each Windows session.
  3. Select the machine on which UFT is installed as the load generator.
  4. Run the test.

References:

https://community.microfocus.com/t5/Application-Delivery-Management/Running-Unified-Functional-Testing-tests-in-Performance-Center/ba-p/1673229

https://admhelp.microfocus.com/lr/en/2020/help/WebHelp/Content/Controller/ c_quicktest_in_lr_guidelines.htm

Categories: Load Runner, UFT/QTP

Tagged as:

Leave a Reply