Create a Vuser script in Eclipse

LoadRunner Professional's basic IDE add-in for Eclipse enables you to 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.



Make sure you have a supported JDK version installed on your machine, for example, JRE 7 (see the Support Matrix for all supported versions).

After you install it:

  1. Open Eclipse and select Window > Preferences.
  2. Navigate to the Java > Installed JREs node. If the installed version is not in the Installed JREs list, click Add and use the wizard to add its folder. For example, for JDK 1.7 (JRE 7): C:\Program Files\Java\jre7.
  3. In the Installed JREs list, click the appropriate check box (for example, jre7) to instruct Eclipse to use this version.
  4. Close Eclipse.

Back to top

Method 1: Create a script in VuGen, and develop it further in Eclipse

  1. Open VuGen and create a new Java type script.

  2. Record or add steps as you normally would.

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

Back to top

Method 2: Create the script in Eclipse

  1. Manually copy the file from your LoadRunner Professional installation package's Additional Components\IDE Add-Ins\EclipseAddin folder into the Eclipse dropins folder. Extract the files from the jar file.

  2. 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.)

Back to top

Develop the script in Eclipse

  1. Expand the script's node and select the default package > node. Code the script as you normally would in the Eclipse editor, in the appropriate sections.

  2. In the script's node in the Package Explorer, expand Referenced Libraries > classes > lrapi > to access the desired LoadRunner Professional elements, such as transactions, rendezvous points, and messages.

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

  4. Save and run the project. Select Vuser > Run Vuser to test the script. Then select Vuser > Create Load Scenario to run it from Controller. Note that you will not be able to open this script in VuGen once you edit it in Eclipse.

Back to top

See also: