HP, Performance Testing, Testing, Tools

Solving Error -26630: HTTP Status-Code=401 (Unauthorized)

You might have faced below error during replay of your script, though your script has web_set_user() function. In this article we will see how to fix it using various methods.

Error -26630: HTTP Status-Code=401 (Unauthorized) 

Basically above error occurs when the application is trying to validate the simulated request with proper credentials and header information. If any critical parameters missing in the header, LoadRunner throws above error.

Fix 1:

Make sure that you have added valid details in the web_set_user() function. It should have valid user identity, password, and the host & port details. It is good to incorporate the password in the encrypted format using lr_decrypt functions. Below is the perfect example of web_set_user function.

web_set_user(“mydomain\\myuserid”, lr_decrypt(“4042e3e7c8bbbcfde0f737f91f”), ” mydomain:8080″);

Fix 2:

You can try running the script using WinInet replay instead of Sockets. To change the settings, go to Runtime Settings > Preferences, check Use WinInet replay instead of Sockets (Windows only)

Preferences Options
Preferences Options

Fix 3:

If above two fixes doesn’t work, you need to compare and validate the complete request of LoadRunner and the complete request from Fiddler.


Run the script in LoadRunner by turning on the extended log (preferably with Parameter Substitution and Data returned by server) and capture the request headers, cookies, etc.

Now, open Fiddler and manually navigate the business flow and then compare the request header information with LoadRunner info. If there is a mismatch, you need to incorporate it in the LoadRunner script. E.g. Fiddler request headers had authorization headers, accept encoding etc. You need to use web_add_header function to add the details to the script.  If you use any other methods to fix unauthorized error, please let me know in the comments section.

If you like my article, please do share in your favorite social media. Please do not forget to subscribe to my weekly newsletter, it is FREE.

Once a week we send a digest with the most popular articles.

One Comment

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

New Year. New Hope. Learn TruWeb. 78% OFF for Limited Time of my Udemy course..BUY NOW