loadrunner is there any way to treat HTTP 401 as not an error? Application...

  • perf-test.com need your contributions to build up a strong repository of performance engineering resources.

F

Firdaus Kamaruddin

Guest
is there any way to treat HTTP 401 as not an error? Application like IBM Worklight utilize this type of http response as a valid response for the authentication purpose
 
Hi Firdaus, you may control error handling for a specific segment of the script, by inserting the lr_continue_on_error function before and after the desired segment. Ex: To instruct the test run component to continue on error for the entire script except for this segment, enclose the segment with lr_continue_on_error statements. lr_continue_on_error (0); lrd_stmt(Csr1, "select..."...); lrd_exec(...); lr_continue_on_error(1);
 
Thanks for the response. Actually currently im using that function but it is still treat the response as error. Futhermore, the function will hide other valid http response such as 500. It also make your analysis graph full of this error
 
Query google for "Loadrunner 401 web_add_auto_header" and you should find some interesting links which will help you
 
Thanks James Pulley. I have done that queries in the past and have seen the solution given. But it is not the same as my situation whereas the server is actually sending a valid 401 response with security challenges value in which i need to correlate and put in the header for the next request. Even when we use browser also this 401 is occured. Or maybe you can correct me. Here is the official link given by IBM on this matter. https://www.ibm.com/developerworks/..._worklight_server_performance_testing?lang=en
 
I think you don't need to correlate these values. If these 401s are part of windows NTLM authentication, Under script run time setting/preferences, enable NTLM authentication option. And script should take care of it.
 
401 is expected from server. so vugen cant handle it in a normal as vugen treat 401 as error. It is nothing wrong with vugen configuration, it is just the way the application work. My queries is to make vugen treat 401 as non-error for a specific http request
 
Your tool should not change the status of information coming back from the server because you don't want to see it. This is an education issue for the consumers of your performance testing data, or you could simply build a custom report from the test data which does not include 401 data. There are many ways to generate this custom report, from the custom reporting features/templates in Analysis, to an export and modification of the report of web page. Heck, you might even use a combination of template, auto output of a web page and then SED to modify the page source for the 401 to change it to "401 - expected authentication challenge for application x" in your reporting, or you could just update the value of the 200's and remove the line for 401. I personally would never consider such a path and would go down the education path with the consumers of the data, but that is your choice.
 
thanks James Pulley. Which means there is no direct approach to tackle my question in vugen. But I do agree with you regarding the education to the consumer, it just that usually it is hard to convince some stubborn guys .
 
Given the number of unscrupulous testers in the market who will change results to make a customer happy, think about what this implies for a tool like Jmeter where you can apparently change a 401 to a 200 for reporting. Why wouldn't some tester who is being yelled at for having 500 or 503 items show up in a report simply change how they were being collected/reported? There is no doubt this has happed.
 
Use web_get_int_property function to get the http status code of the particular request and if it is 401 then create an error handling mechanism to pass the request. Enable continue on error option in the RTS. Hope it will resolve your issue.
 
Thanks for the comment, but if you read my comment above, I already said i already doing whatever you have suggested. It does required a bit of coding to filter only 401 error which is why i asking for simpler solution
 
By default anything other than http 200 ok response will be considered as error response in load runner. So if you want to bypass and make it pass, above is the easiest way to do. See the help reference for web_get_int_property function you will find it as simple solution.
 
The above statement regarding only 200 is considered a non error is provably false. I preset the remainder of the 200 series of http statuses as well as the enter 300 series. 401 is a security challenge response after which web_set_user credentials are presented and it is not handled as an error but a standard security handshake