How to use Eclipse for Java Vuser Script Development in LoadRunner: LoadRunner is one of the most popular licensed performance testing tools, Load runner is acquired and managed by Micro Focus company, LR supports almost all types of protocols like Mobile, Web, Database,  Java, Web Sockets, etc., performance testing.

LoadRunner has 3 components which are Vugen, Controller, and Analysis. These 3 components are used to do end-to-end testing.

Vugen is generally used to record user flow and enhance them to work for multiple users and add dynamic data as input using parameterized and correlation to support multiple users.

Adding page assertions will be validating the page is a valid response or not

In VuGen we have multiple protocols like HTTP.Java Vuser, ODBC, SMTP, POP3, Dev web, etc, and Oracle, etc, each protocol has its importance and will be choosing the respective protocol based on the requirements.

If you want to create scripts for web applications will be using HTML/web, and Dev web protocol, if you want to create DB scripts then will be using ODBC/java Vuser protocol, For communicating with queues then Java Vuser/ Web services. As per requirement will be creating the scripts using the suitable protocol.

How to use Eclipse for Java Vuser Script Development

In the Java Vuser protocol, we will be using java code for achieving your requirement like sending messages to the Message queue server and topics or doing JDBC calls using java.

In LoadRunner, we have 3 files for any protocol init, Action, and end.

These 3 files will run accordingly as mentioned order. In Java Vuser also we will have 3 files but we will be using only 1 file which is Action.java

Load runner VuGen will create 3 methods which are init(), action(), end() in Action.java.

These 3 methods behave as the same other protocol init, action and end files

  1. init()
    • In this method, we need to write code for objects which need to initialize only once
  2. action()
    • In this method, we need to write the actual requirement of our script like sending messages to topics or queues, or JDBC executing the query, etc,
  3. end()
    • In this method, we need to close the objects or connections or  steps we need to do before your code stops executing

For writing code in action method or in Action java file, VuGen does not support the features that general IDE supports like suggesting methods and easy ways to write code

LoadRunner gives privileges to use eclipse IDE and develop the Java Vuser script and compile it but for replaying it we need to use LR only

How to use Eclipse &  LoadRunner to design JavaScript?

Pre-requisites:

  • We need to install eclipse before we start integrating eclipse with VuGen while installing eclipse try the eclipse version which is compatible with the VuGen version, try eclipse which is released before version your VuGen version.
  • Install the JDK version compatible with VuGen you are using & eclipse

The setup process is as below:

  • Open/Create your Java Vuser script in LoadRunner
  • After the script is opened click below as mentioned below

How to use Eclipse for Java Vuser Script Development in LoadRunner

  • After clicking the eclipse button it will open pop up to select the eclipse installation path

How to use Eclipse for Java Vuser Script Development in LoadRunner

  • Browse the eclipse exe file and select
  • After selecting Load runner will open eclipse & prompts for a new workspace to create
  • After creating a new workspace eclipse will open your script in the eclipse workspace like  below

How to use Eclipse for Java Vuser Script Development in LoadRunner

  • We can write a complete script in eclipse and which will help for easy development and we can add a dependency jar to build the path
  • After designing your script just need to save it will automatically reflect in your VuGen script
  • We can replay it from VuGen and check your script works

Note: if you don’t see your script opened in eclipse then it is most probably LR and eclipse version mismatch, so use the eclipse versions which are released before your VuGen is released so that you will not see any issues in integration

Hope this will help you create a Java Vuser script.

How to use Eclipse for Java Vuser Script Development in LoadRunner

2 thoughts on “How to use Eclipse for Java Vuser Script Development in LoadRunner

Leave a Reply

Your email address will not be published. Required fields are marked *