How to Add External Jars in LoadRunner Java Vuser Scripts: LoadRunner is one most popular licensed performance testing tools, LoadRunner 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.

How to Add External Jars in LoadRunner Java Vuser Scripts

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

Adding External Jars in LoadRunner

Java Vuser Protocol: We can use the Java Vuser protocol for DB calls & communicating with message brokers like Kafka, Rabbit MQ, Active MQ, etc and even we can use for HTTP calls by writing more code for HTTP connection from VuGen.

In this post will learn how to add the external jars which are supported for your scripts by creating a simple script

  • First, we need to create a new script which should be Java Vuser protocol like below

  • After clicking create button VuGen will create a new script and open a screen as shown below

  • Now open the run-time setting option showing on the left side after opening will be seeing a screen like below

  • Select the Classpath option in the run-time setting

  • By using Add file button we can browse and select the desired jar file to add to the script
  • After adding jars to your script don’t delete from the path where you selected the jar file
  • we can add any number of jars by clicking add button and saving it

To download jars we can use the maven repository to download search for you jars file you needed like Kafka or active MQ or any JDBC driver jars or any other supported jars while searching or downloading we need to select the version which is compatible with you server which you are trying to connect.

After selecting a specific version and we can click on jar like as shown below to download

Use the link which I have highlighted on the above screen, after clicking on the screen latest browsers will prompt you not to download or delete the downloaded from click ignore, and you will be seeing an option called keep file and copy the jar to another folder that is not deleted accidentally by any user and follow the above steps to add jars to the classpath as mentioned

repeat the same steps I mentioned above for adding jars.

Happy Learning

How to Add External Jars in LoadRunner Java Vuser Scripts

Leave a Reply

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