(LR) Support Tip: LoadRunner Eclipse Add-in for Developers
- 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.
- 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.
- In Eclipse, open your Selenium or JUnit test.
- Code the test as you normally would in Eclipse.
- Build your java classes.
- Select Devops Vuser > Add LoadRunner API Reference to add the desired LoadRunner functions to your script as well as transactions, rendezvous points, and messages.
- Expand the Devops Vuser menu and enhance the test with runtime settings and parameters.
- Select Devops Vuser > Run Vuser to run the test from within Eclipse to verify its functionality.
- Use the Devops Vuser menu to launch the LoadRunner Controller, or add the test to a Controller scenario that is already open.
- 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:
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.
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution