LoadRunner and Performance Center Blog
cancel

Running Unified Functional Testing tests in Performance Center/LoadRunner

Running Unified Functional Testing tests in Performance Center/LoadRunner

Micro Focus Expert

(This post was written by Alexandru Postiniuc from Performance Center Quality team)Postinyuk.jpg

 

 

 

Micro Focus® Unified Functional Testing (UFT) enables you to create complex tests that examine the full spectrum of your application's functionality and API.

 Micro Focus® UFT Pro (LeanFT) is a powerful yet lightweight functional testing software solution built specifically for continuous testing and continuous integration.

 If you want to check how your application’s functionality is affected by heavy load, you can integrate UFT and LeanFT tests into Performance Center or LoadRunner in the form of GUI Vuser scripts, and execute them inside a load testing scenario.

This post explains how to set up the Performance Center or LoadRunner integration with UFT and LeanFT, and how to successfully manage assets in order to accomplish the desired test.

Performance Center   

1. Integration for UFT GUI and UFT API

1.1 UFT GUI

1.1.1 Prerequisites:

  • To run UFT tests from Performance Center, you need a LoadRunner GUI Virtual User bundle license.

1.1.2 Create the GUI Test in UFT

  • When creating a GUI test, make sure you allow UFT to interrupt the desktop.
  • 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.

For example:

“Services.StartTransaction "transaction1"/ Services.EndTransaction "transaction1"

These transactions are displayed when the test is run. If for example a verification point is valid, the transactions will be passed.

1.1.3 Run the UFT GUI Test

  1. 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.                                                                                                                run uft.png                  
  2. Create a Performance Center test, and assign the UFT test to it.
  3. 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.
  4. Select the machine on which UFT is installed as the load generator.
  5. Run the test.

 

1.2 UFT API

1.2.1 Prerequisites:

  • A GUI license is not necessary.

1.2.2 Create the API Test in UFT

1.2.3 Run a UFT API Test

  1. 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.

 run uftapi.png

 

  1. Create a Performance Center test, and assign the script to it.
  2. Set the number of Vusers per group.
  3. Select the machine on which UFT is installed as the load generator.
  4. Run the test. UFT API tests do not have the same constraints as GUI tests related to the number of Vusers that can be run per load generator.

 

2. Supported SDKs

 

2.1 LeanFT NUnit

2.1.1 Prerequisites:

  • For running NUnit tests from Performance Center, the same version of NUnit Framework must be installed on the load generator machine and on the one used for test creation (the one installed as NuGet package). If the versions are different, errors might occur during the test run.
  • Make sure that framework.dll resides in the same directory as the NUnit test.

2.1.2        Create the LeanFT NUnit test

  • Create a LeanFT NUnit test, and save it on your file system.
  • If you plan to use the test in Performance Center, you need to convert it to a VuGen script before uploading it to Performance Center. Use the VuGen Script Converter to convert the LeanFT test to a Unit Test for .NET LoadRunner script (see steps below).

2.1.3 Run the test from Performance Center

  1. Download the VuGen Script Converter. This must be installed on a machine that has the same NUnit Framework installed as the one used when creating the LeanFT NUnit test.
  2. In the upper-right corner of the My Performance Center window, click Settings icon, and select Download Applications.
  3. Select VuGen Script Converter and click Download.
  4. Install the script converter and run exe.

Note: VuGen Script Converter can be run from Performance Center host machine. To do so, select Start > All Programs > Load Runner > Tools > VuGen Script Converter.

  1. Convert the test to a VuGen script.

Select the test and specify a location for saving the converted script. Click Convert. The converted script is saved in ZIP format.

Tip: Alternatively, you can convert a test to a VuGen script from a command line. For details, see the Performance Center help.

 

  1. Upload the converted VuGen script to Performance Center.
  2. On the My Performance Center navigation bar, select Test Management.
  3. In the test management tree, select a folder in which you want to upload the script.
  4. Click the Upload Scripts button, select the zip file created by the converter utility, and click Upload.
  5. Create a test using the script. Assign as the load generator a machine that has LeanFT and the relevant prerequisites installed on it.
  6. Run the test.

 

2.2 LeanFT JUnit

2.2.1 Prerequisites

  • For running JUnit tests from Performance Center, JDK needs to be installed on the machine used as the load generator.
  • If your test has dependencies, verify that they are available on the load generator machine with the same paths as defined under Runtime Settings > Classpath.
  • You must have the JAVA_HOME environment variable included in the PATH variable on the load generator and Controller machines were applicable (to avoid displaying an error that Java is not installed).

2.2.2 Create the LeanFT JUnit test

  • Create a LeanFT JUnit test, and save it on your file system.
    • If you plan to use it in Performance Center you need to use VuGen Script Converter before uploading.

2.2.3 Run from Performance Center

  1. Download the VuGen Script Converter. This must be installed on a machine that has the same NUnit Framework installed as the one used when creating the LeanFT JUnit test.
  2. In the upper-right corner of the My Performance Center window, click Settings icon, and select Download Applications.
  3. Select VuGen Script Converter and click Download.
  4. Install the script converter and run exe.

Note: VuGen Script Converter can be run from Performance Center host machine. To do so, select Start > All Programs > Load Runner > Tools > VuGen Script Converter.

  1. Convert the test to a VuGen script.
  2. Select the test and specify a location for saving the converted script. Click Convert. The converted script is saved in ZIP format.

Tip: Alternatively, you can convert a test to a VuGen script from a command line. For details, see the Performance Center help

 

  1. Before running the converted VuGen scripts, make sure to update Runtime Settings > Java Environment Settings > Classpath of the Vuser group, with the JUnit path and the dependent jars.
  2. Upload the converted VuGen script to Performance Center.
  3. On the My Performance Center navigation bar, select Test Management.
  4. In the test management tree, select a folder in which you want to upload the script.
  5. Click the Upload Scripts button, select the zip file created by the converter utility, and click Upload.
  6. Create a test using the script. Assign as the load generator a machine that has LeanFT and the relevant prerequisites installed on it.
  7. Run the test.

 

You can learn more about running Unified Functional Testing tests in Performance Center from the Performance Center Help.

 

LoadRunner

1. Integration for UFT GUI and UFT API

1.1 UFT GUI

1.1.1 Prerequisites:

  • To run UFT tests from LoadRunner, you need a LoadRunner GUI Virtual User bundle license.

1.1.2 Create the GUI Test in UFT

  • When creating a GUI test, make sure you allow UFT to interrupt the desktop.
  • UFT checkpoints are not recognized by LoadRunner. Therefore, if you want to check the PASS/FAIL criteria of checkpoints in LoadRunner as well, you need to surround them with transactions.

For example:

“Services.StartTransaction "transaction1"/ Services.EndTransaction "transaction1"

These transactions are displayed when the test is run. If for example a verification point is valid, the transactions will be passed.

1.1.3 Run the UFT GUI Test from Controller

  1. Upload the test directly into Controller as LoadRunner Scripts.

 Fromcontroller.png

 

  1. Set the number of Vusers to run per load generator.
    • 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.
  2. Run the scenario.

 

1.2 UFT API

1.2.1 Prerequisites:

  • A GUI license is not necessary.

1.2.2 Create the API Test in UFT

1.2.3 Run API UFT Test from Controller

  1. Upload the script directly into Controller as LoadRunner Scripts.

 FromcontrollerAPI.png

 

  1. Run the scenario. UFT API tests do not have the same constraints as GUI tests related to the number of Vusers that can be run per load generator.

 

2. Supported SDKs

2.1 LeanFT NUnit

2.1.1 Prerequisites:

  • For running NUnit tests from LoadRunner, the same version of NUnit Framework must be installed on the Controller as the one used for test creation (the one installed as NuGet package). If the versions are different, errors might occur during the test run.
  • Make sure that framework.dll resides in the same directory as the NUnit test.

2.1.2        Create the LeanFT NUnit test

  • Create a LeanFT NUnit test, and save it on your file system.
  • If you plan to use the test in LoadRunner, you can import it to Controller by selecting the appropriate script type (System or Unit Tests). Controller will automatically convert the LeanFT test to a Unit Test for .NET LoadRunner script.

 

2.1.3 Run from Controller

  1. To run a LeanFT NUnit test from Controller, load the .dll file of the solution and select System or Unit Tests

 FromcontrollerAPI3.png

 

  1. Configure the scenario according to your needs.
  2. Run the scenario using the machine that has LeanFT installed as the load generator.

 

2.2 LeanFT JUnit

2.2.1 Prerequisites

  • For running JUnit tests from LoadRunner, JDK needs to be installed on the Controller and load generator machines.
  • If your test has dependencies, verify that they are available on the load generator machine with the same paths as defined under Runtime Settings > Classpath.
  • You must have the JAVA_HOME environment variable included in the PATH variable on the load generator and Controller machines were applicable (to avoid displaying an error that Java is not installed).

2.2.2 Create the LeanFT JUnit test

  • Create LeanFT JUnit test and save it on your file system.
    • If you plan to use it in LoadRunner, you can import it to Controller by selecting the appropriate script type (System or Unit Tests).

2.2.3 Run from Controller

  1. To run a LeanFT JUnit test from Controller, load the .java file of the solution and select System or Unit Tests

 FromcontrollerAPI4.png

 

  1. Configure the scenario according to your needs.
  2. Run the scenario using the machine that has LeanFT installed as the load generator

You can learn more about running Unified Functional Testing tests in LoadRunner from the LoadRunner Help Center.