Softlogic Systems - Placement and Training Institute in Chennai

Easy way to IT Job

LoadRunner Scripting Challenges and Solutions
Share on your Social Media

LoadRunner Scripting Challenges and Solutions

Published On: November 25, 2024

Introduction

Typically, a LoadRunner test script is extremely simple: click the record button, complete any necessary browser actions, and click the “Stop Recording” button. However, the outcomes may be different from what you anticipated. These are the top LoadRunner challenges that arise while recording a test using the HTTP/HTML protocol on the Web, along with solutions. Our LoadRunner course syllabus helps you to learn more. 

Correlation Challenges in LoadRunner

One of the fundamental skills of LoadRunner scripting is correlation. Even though correlation is a strong and necessary element in LoadRunner, it has drawbacks. The correlation procedure may become complicated and time-consuming due to these difficulties.

The following are some common challenges encountered when using LoadRunner’s correlation feature:

1. Challenges in Recognizing Changing Values with LoadRunner

Finding the dynamic values that require correlation is one of the main problems with correlation.

Challenge: Particularly in intricate applications with numerous dynamic values, this data can be obscured in different sections of the server response and is challenging to identify.

Solution: It necessitates carefully examining the server responses and a solid grasp of how the program works.

If you are new to LoadRunner, get a basic understanding through our beginner-friendly LoadRunner tutorial.

2. Challenges in Managing Intricate Correlation Situations with LoadRunner

Challenge: Complex correlation scenarios, including several dynamic values that need to be correlated in a particular order, are present in some applications. 

Solution: Managing these intricate situations can be difficult and calls for a high level of skill.

3. Challenges in Creating a Correlation Code with LoadRunner

Challenge: It can be intimidating to write the correlation code by hand. Beginners or anyone who is not familiar with the LoadRunner scripting language will find it particularly difficult.

Solution: It necessitates a thorough comprehension of correlation functions and their efficient use.

4. Challenges in Handling Dynamic Values That Are Unpredictable

Challenge: Correlation can cause some dynamic variables to alter in unforeseen ways.

Solution: This can be quite difficult and call for sophisticated correlation methods or unique solutions.

5. Challenges in Maintaining Correlation Rules

Challenge: As the application develops over time, it could be necessary to adjust the correlation rules. 

This work can be difficult, particularly when dealing with lengthy scripts that contain a lot of changeable information.

Solution: The correlation rules must be updated and maintained regularly to stay valid.

6. Challenges in Limited Automatic Correlation Success

Challenge: Time can be saved with automatic correlation. It only works occasionally, particularly in intricate applications.

Solution: It might not produce the appropriate correlation rules or identify all of the required dynamic values. This may result in full or accurate correlation, necessitating human involvement.

7. Challenges in Overhead Performance in LoadRunner

Challenge: Additional processing is required for correlation in order to record and substitute dynamic values. This may result in additional execution overhead for the script, particularly for scripts having a large number of correlation criteria.

Check out our top 20 LoadRunner project ideas for your practical understanding.

8. Common Solutions for Various Correlation Challenges in LoadRunner

The following are some common solutions for correlation challenges in LoadRunner:

Use Automatic Correlation

Dynamic data can be detected and correlated using LoadRunner Professional’s automatic correlation types. Among these kinds are:

  • Rule-based correlation: Correlates dynamic values in known settings using predetermined rules.
  • Recording-based correlation: Looks for correlation candidates in the client request steps of the script.
  • Replay-based correlation: Looks for values that don’t match by comparing server responses before failures.  
Use manual correlation.

Because manual correlation is more accurate than automatic correlation, it is typically chosen.

Utilize the function web_reg_save_param().

To deal with dynamic correlation involving numerous instances of the same value, use this function in conjunction with the ORDINAL argument. To record all occurrences, set ORDINAL to “ALL”.

Utilize a for-loop 

To access particular instances, go through the recorded values using a for loop and either lr_paramarr_random() or lr_paramarr_idx().

The technique of recording dynamic values that the server returns and using them in later requests is known as correlation. A parameter containing these values is subsequently used in the ensuing requests. Review your skills with our LoadRunner interview questions and answers

Scripting Challenges in LoadRunner and Solutions

Here are the scripting challenges in LoadRunner: 

1. No Events Are Being Recorded

Challenge: The created script is empty, but the events counter continues to rise.

  • This might be the result of VuGen’s recording mechanism’s inability to recognize HTTP data. 

Solution:

  • Verify that your program does use HTTP web traffic to resolve it. 
  • Make sure you select the appropriate SSL version (SSL 2, SSL 3, TLS) in the Port Mapping window, which can be accessed by choosing the “Options” button on the Record > Recording Options… menu if the application makes use of SSL connections.

2. Specific Events Are Not Recorded

Challenge: The event may have been dropped because it was deemed “uninteresting.” 

  • Client queries that return an HTTP response status of 2xx or 302 are automatically recorded by VuGen’s Web (HTTP/HTML) protocol, which thereafter discards all other requests. 

Solution: You can change the registry to tell VuGen to create a command for a missing request if it throws back a rejected response, like 301:

Find the registry key listed below: 

  • [HKEY_CURRENT_USER\Software\MercuryInteractive\Networking\MultiSettings\QTWeb\Recording]
  • To it, append the subsequent string value:
  • “GenerateApiFuncForCustomHttpStatus”=”301”

3. The Recorded Application Stops Responding

The inability of VuGen’s recording mechanism to establish a connection with the application’s server may be the reason for this. 

Errors related to network connections are visible in the recording log:

[Net An. Warning (1068:197c)] Request Connection: Remote Server @ 123.123.123.123 – 5222 (Service=) Failed attempt #1. Unable to connect to remote server: rc = -1 , le = 10060) [Net An. Warning (1068:197c)] Request Connection: Remote Server @ 123.123.123.123 – 5222 (Service=) Failed attempt #2. Unable to connect to remote server: rc = -1 , le = 10060)

Solution: If the communication to 123.123.123.123:5222 is not necessary for the business process and can be skipped, this workaround can be used. 

  • The identical entry should still be added but marked as checked if that isn’t the case. 
  • This will guarantee that the right traffic is captured at this address.

4. The recorded program displays an error message regarding the incorrect server certificate during the recording.

Challenge: The client side’s incapacity to confirm the server certificate’s legitimacy is the root of the issue. 

Solution: To resolve this issue, add the LoadRunner Certificate Authority (CA) file to the computer’s “Trusted Root Certificate Authorities” certificate store (if the application is a Java client, use the keytool to add LoadRunner’s CA to Java’s trusted CA list). 

This file, named wplusCAOnly_Expiration_2022.crt, comes with LoadRunner. 

The folder contains it.

  • Double-clicking the file will reveal the certificate, which you can then add to the store:
Load Runner Scripting Challenges
Load Runner Scripting Challenges
  • The Certificate Import Wizard will then open after you click “Install Certificate”:
Load Runner Scripting Challenges 1
Load Runner Scripting Challenges 1
  • Make sure you choose “Trusted Root Certification Authorities” and tick the box for “Place all certificates in the following store.” 
  • You should be able to record the application once the wizard is finished.

5. When utilizing the Ajax Click and Script protocol, the browser breaks while recording.

Challenge: This may occur if VuGen is unable to recognize certain Ajax controls within the application.

Solution: To correct it: 

Open the <LR_folder\dat\protocols> folder and open the WebAjax.lrp file.

Give the following comment: 

DllGetClassObject:jscript.dll=DllGetClassObjectHook:ajax_hooks.dll (simply put a semi-colon (‘;’) in front of the line)

The application should now be able to be recorded.

Leverage our software training courses to kickstart your IT career.

Conclusion

These LoadRunner challenges and solutions can assist you in finding the simplest answers to challenging coding situations. Enhance your software testing skills with our LoadRunner training in Chennai.

Share on your Social Media

Just a minute!

If you have any questions that you did not find answers for, our counsellors are here to answer them. You can get all your queries answered before deciding to join SLA and move your career forward.

We are excited to get started with you

Give us your information and we will arange for a free call (at your convenience) with one of our counsellors. You can get all your queries answered before deciding to join SLA and move your career forward.