Upload and run JUnit or Selenium tests

This topic describes how to create and run JUnit or Selenium tests from LoadRunner Enterprise.

Prerequisites

  • Configure the load generator machine the same way as the machine that is used to record or prepare the script or test.

  • For running JUnit tests from LoadRunner Enterprise, 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).

  • Create a JUnit or Selenium test, and save it on your file system.

    Note:  

    • The file path inside a script folder must not exceed 260 characters.

    • You will need to convert the test to a VuGen script before uploading it to LoadRunner Enterprise (described in Run the test from LoadRunner Enterprise below).

Back to top

Develop a JUnit or Selenium test using Eclipse

Develop the JUnit or Selenium test in Eclipse using the LoadRunner Eclipse Add-in for Developers. This requires:

  1. Installing the IDE for Eclipse Dev add-in for your Eclipse version.

  2. Adding the LoadRunner API functions to your test.

For details, see Develop a Unit Test Using Eclipse (JUnit or Selenium test) in the LoadRunner Professional Help Center.

Back to top

Run the test from LoadRunner Enterprise

This topic describes how to run JUnit or Selenium tests from LoadRunner Enterprise.

  1. Download the VuGen Script Converter.

    This must be installed on a machine that has the same JUnit Framework installed as the one used when creating the JUnit test.

    1. From the LoadRunner Enterprise navigation toolbar, click and selectDownload Applications.

    2. Select VuGen Script Converter and click Download.

    3. Install the script converter and run VuGenScriptConverter.exe.

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

  2. Convert the test to a VuGen script.

    You can convert a test to a VuGen script using the script converter, or convert it automatically from a command prompt.

  3. Upload the converted VuGen script to LoadRunner Enterprise.

    1. From the LoadRunner Enterprise navigation toolbar, click and select Test Management.

    2. In the test management tree, select a folder in which you want to upload the script, and click the Upload Scripts button.

    3. Select the zip file created by the converter utility, and click Upload.

    For details, see Upload scripts.

  4. Create a test using the script.

    Assign as the load generator a machine that has JUnit and the relevant prerequisites installed on it.

    For details, see Design performance tests.

  5. Run the test.

    For details, see Run performance tests.

Back to top