HTTP Status-Code=401 (Unauthorized) for http:.......

374 views
Skip to first unread message

sarah...@gmail.com

unread,
Jun 28, 2017, 1:26:09 PM6/28/17
to LoadRunner

Hi,

My script is showing the 401 error as soon as login occurs.  I've set web_set_user(....) and web_set_max_html_param_len("100000").  Manually when I login I see no errors.

I've compared the recorded request header with the Replay request header of the failed request and found that cookie value and UserAgent values are differnt.
So I correlated the value under cookie and added the Web_add_header right before the failed request.  No problems with correlation, I've set the extended log so I see the correct values are being
correlated.  I also add the web_add_header for User-Agent.  I'm still getting the 401 error.  I think I might be doing something wrong in the web_Add_header for User-Agent.  Any ideas would be appreciated.

Thanks

Headers I've added before the failed request.

web_add_header("Cookie","ABCD_MYAPP-Web_AAC_09K={MyID1};BAB_MYAPP-BCS_09K={MyID2}");
web_add_header("User–Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko");


Recorded Request header

****** Request Header For Transaction With Id 157 ******
GET ...........SOMEURL here HTTP/1.1
Accept: */*
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
DNT: 1
Host: Url here
Cookie: ABCD_MYAPP-Web_AAC_09K=1437111122.90711.0002; BAB_MYAPP-BCS_09K=1121334004.98763.0001
Connection: Keep-Alive
Referer: ........URL here
$$$$$$ Request Header For Transaction With Id 157 Ended $$$$$$


Replay Request header


Action.c(142):      t=7619ms: 493-byte request headers for "https: URL HERE" (RelFrameId=1, Internal ID=14)
Action.c(142):     GET /URL HERE\r\n
Action.c(142):     Referer: https:/URL HERE \r\n
Action.c(142):     DNT: 1\r\n
Action.c(142):     User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko\r\n
Action.c(142):     Accept-Encoding: gzip, deflate\r\n
Action.c(142):     Accept-Language: en-US\r\n
Action.c(142):     Accept: */*\r\n
Action.c(142):     Connection: Keep-Alive\r\n
Action.c(142):     Host: URL here
Action.c(142):     Cookie: ABCD_MYAPP-Web_AAC_09K=1487968332.53111.0000; BAB_MYAPP-BCS_09K=1323498400.34363.0001
Action.c(142):     0\r\n
Action.c(142):     \r\n

aditya thella

unread,
Aug 16, 2017, 10:48:37 AM8/16/17
to LoadRunner
Hi,

Please do check whether you see similar to 401 in network log in chrome browser by clicking F12 and check it.
The modern application behavior is like sending a request->server will send unauthorized response and asks for credentials->send credentials.  

Thanks,
Adithya.

krishna kumar

unread,
Aug 17, 2017, 10:02:32 AM8/17/17
to LR-Loa...@googlegroups.com
Hi

Please check the wininet option in runtime setting

--
You received this message because you are subscribed to the Google Groups "LoadRunner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to LR-LoadRunner+unsubscribe@googlegroups.com.
To post to this group, send email to LR-Loa...@googlegroups.com.
Visit this group at https://groups.google.com/group/LR-LoadRunner.
To view this discussion on the web visit https://groups.google.com/d/msgid/LR-LoadRunner/b91c25b1-4d8c-4b2f-bceb-b1382996f25b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages