Regular Contributor.
Regular Contributor.

(LR) Support Tip: LoadRunner Eclipse Add-in for Developers

The IDE add-in for Developers allows you to create and run a unit test directly from within Visual Studio or Eclipse. The run mechanism is VuGen's mdrv process. This add-in adds a Devops menu to the Visual Studio or Eclipse interface. You can configure runtime settings directly from your development environment and run the test. The saved tests, NUnit (Visual Studio) or JUnit (Eclipse), can be referenced directly from your testing environment, for example, a LoadRunner scenario.
To create a unit test in Eclipse:
  1. Make sure you have JDK 1.7 (JRE 7) on your machine. Go to java.com to check your version or download the required version. After you install it, open Eclipse and select Window > Preferences. Navigate to the Java > Installed JREs node. If jre7 is not in the Installed JREs list, click Add and use the wizard to add its folder (for example c:\Program Files\Java\jre7). In the Installed JREs list, click the check box by jre7 to instruct Eclipse to use this version.
  2. Run the Eclipse Dev add-in, LREclipseIDEAddInDevSetup.exe, from the download/DVD folder: Additional Components\IDE Add-Ins Dev. After installing the Eclipse add-in, rebuild the plugin cache by running the following command line string: Eclipse.exe -clean.
  3. In Eclipse, open your Selenium or JUnit test.
  4. Code the test as you normally would in Eclipse.
  5. Build your java classes.
  6. Select Devops Vuser > Add LoadRunner API Reference to add the desired LoadRunner functions to your script as well as transactions, rendezvous points, and messages.
  7. Expand the Devops Vuser menu and enhance the test with runtime settings and parameters.
  8. Select Devops Vuser > Run Vuser to run the test from within Eclipse to verify its functionality.
  9. Use the Devops Vuser menu to launch the LoadRunner Controller, or add the test to a Controller scenario that is already open.
  10. Add the class file at any time as a unit test, to a LoadRunner scenario.

It is very important to use the supported Eclipse versions, for LoadRunner 12.53:

image text

To run JUnit tests in eclipse, the hp.lr.vugeneclipse42addin.jar is not needed.
It is important to note that during the installation the correct Eclipse installation folder must be selected.

Regarding the 'Add Loadrunner API Reference' menu, be sure the project node is selected when clicking the DevOps Vuser menu.
Alternatively, you can select this option from the project node's context menu (select the project node in Package Explorer, right click on it and select the "Add LoadRunner API Reference" option).

The Add LoadRunner API Reference menu option does not add the 'import lrapi.lr;' to the code, it adds LoadRunner classes as referenced libraries in your project (you can see them in the Package Explorer under 'Referenced Libraries', where many classes are added.
You'll need to add 'import lrapi.lr;' to your code by yourself.

Note that all the prerequisites should be there (JDK 1.7 32bit, Selenium or JUnit project with at least one valid test class).


If you are customer you can try posting on our internal forums for more personalized support.


Performance Center:

How to:


If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution

Labels (1)
0 Replies
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.