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.
Table of Contents
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)
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.
Yes, I have used web_set_sockets_option (“INITIAL_BASIC_AUTH”, “1”); for 401 unauthorized error and it worked for me.
worked for me ..thanks
Hi Naveen
I am trying to record a application with LR12.60 which is SSO. I am using web set user in my script, the script is passing with the recorded user but when I am changing the user it is failing and the error says is unauthorized user. To mention , if I am logging with different user with chrome it is redirecting to the account login user. So manually I can login with account login user but I cannot give new user. If given as I said it will be redirected to login user.
So firstly my question ,can we replicate this with different set of users ?
Note: All the correlations and headers are perfect.
Hi Naveen,
I am facing the this issue exactly at steady state( when ramp up completed).It is a WebServices protocol converted the JSON in to c format and created the scripts.
Scripts are working in Vugen without any issue only in Load test we are seeing the unauthorized issue.
Please share your thoughts on how to resolve this issue. Tried all the above 3 options but no luck.
Hi friends,
I am having the same issue. I am getting below Error:
Action_Gen013_Instant_ID.c(107): Error -26630: HTTP Status-Code=401 (401) for “https://staging.ws.idms.lexisnexis.com/carbon/ws?wsdl” [MsgId: MERR-26630]
Can some please help me