Create a Vuser Script in Eclipse
LoadRunner's basic IDE add-in for Eclipse, lets you create a Java Vuser script in Eclipse. You can begin in VuGen and then open Eclipse. Alternatively, you can work from start to finish in Eclipse.
Note: For details on supported Eclipse versions, see the System Requirements.
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.
- Close Eclipse.
Method 1: Create a script in VuGen, and develop it further in Eclipse
Open VuGen and create a new Java type script.
Record or add steps as you normally would.
Click the Open in Eclipse button on the toolbar. If this is the first time you are opening Eclipse from VuGen, a message box prompts you to enter the Eclipse location. VuGen automatically copies the required files in Eclipse's dropins folder. Eclipse opens with your current script in the Package Explorer pane.
Method 2: Create the script in Eclipse
Manually copy the hp.lr.vugeneclipse42addin.jar file from your LoadRunner installation package's Additional Components\IDE Add-Ins\EclipseAddin folder into the Eclipse dropins folder. Extract the files from the jar file.
Open Eclipse. Select File > New > Project and expand the LoadRunner Script node. You can create any of the Java protocol scripts: Java over HTTP, Java Record Replay, or Java Vuser.
Tip: To verify that the add-in installed correctly, open the Eclipse Installation Details dialog box (Help > About > Installation Details.)
Develop the script in Eclipse
Expand the script's node and select the default package > Action.java node. Code the script as you normally would in the Eclipse editor, in the appropriate sections.
In the script's node in the Package Explorer, expand Referenced Libraries > classes > lrapi > to access the desired LoadRunner elements, such as transactions, rendezvous points, and messages.
Expand the Vuser menu (this may require you to select the parent script name in the Package Explorer) and enhance your script with runtime settings and parameters. For more information, see the runtime setting General > Run Logic or Parameter List Dialog Box.
Save and run the project. Select Vuser > Run Vuser to test the script. Then select Vuser > Create Load Scenario to run it from the Controller. Note that you will not be able to open this script in VuGen once you edit it in Eclipse.