Close

February 28, 2017

List Non-Critical Resource Errors as Warnings in LoadRunner

List Non-Critical Resource Errors as Warnings in LoadRunner

In this article, we are going to understand about List Non-Critical Resource Errors as Warnings in LoadRunner. When you replay the script, sometimes you might have noticed following warning “Warning -26627: HTTP Status-Code=404 (Not Found) for “http://example.com/images/spacer.gif”. We are going to deep-dive into those warnings, understand its importance and how to rectify that in VuGen script.

Types of Resources in LoadRunner

There are two types of resources: Critical and Non-Critical. Non-critical resources such as image, css, js, png, jpeg, icon, java applet etc. The resources which are not impacting your actual business transactions you can call them as non-critical resources.

Critical resources plays an critical role in the actual business transactions. By default, following are the non-resources that are enabled: text/html and text/xml.

If you want *.icon files to be part of non-resources (critical), then you need to add it to the list of non-resources in Recording Options as shown in the below.

List Non-Critical Resource Errors as Warnings in LoadRunner

List Non-Critical Resource Errors as Warnings in LoadRunner

List Non-Critical Resource Errors as Warnings

In this web tours example, I simply logged in and booked the tickets. But when I executed the script, I got the following warnings in the Output log.

vuser_end.c(4): Warning -26627: HTTP Status-Code=404 (Not Found) for “http://newtours.demoaut.com/black”   [MsgId: MWAR-26627]

vuser_end.c(4): Warning -26627: HTTP Status-Code=404 (Not Found) for “http://newtours.demoaut.com/images/spacer.gif”   [MsgId: MWAR-26627]

By default, List Non-Critical Resource Errors as Warnings option is enabled. When the script executes, if the resources (non-critical) throws an error, it will not stop the execution, but rather it will display the errors as warnings.

If you disable List Non-Critical Resource Errors as Warnings option and execute, you will get the following errors.

vuser_init.c(12): Error -26627: HTTP Status-Code=404 (Not Found) for “http://newtours.demoaut.com/black”   [MsgId: MERR-26627]

vuser_init.c(12): Error -26627: HTTP Status-Code=404 (Not Found) for “http://newtours.demoaut.com/images/spacer.gif”   [MsgId: MERR-26627]

What will happen during recording?

During recording, LoadRunner marks each resource attribute as 0 or 1, when you replay, based on the attribute set, the resource will be downloaded or not-downloaded. If the attribute is 0, the resource will be downloaded; if the attribute is 1, the resource will not be downloaded. In below code, the resource attribute marked as 0, which will be downloaded during replay.

web_custom_request(“gn.example.com”,

“URL=http://gn.example.com/“,

“Method=POST“,

“Resource=0“,

“RecContentType=application/ocsp-response“,

“Referer=”,

“Snapshot=t5.inf“,

“Mode=HTML“,

“EncType=application/ocsp-request“,

LAST);

Resource – A value indicating whether the URL is a resource:0 – the URL is not a resource. 1 – the URL is a resource. In below example, you can set the Resoource as either 0 or 1. Both will work without any issues.

web_url(“Logout.gif”,

“URL=http://newtours.demoaut.com/images/forms/Logout.gif“,

“Resource=1“,

“RecContentType=image/gif“,

“Referer=http://newtours.demoaut.com/mercurypurchase2.php“,

“Snapshot=t40.inf“,

“Mode=HTTP“,

LAST);

But the below code only works for the Resource attribute set to 0.

web_url(“newtours.demoaut.com”,

“URL=http://newtours.demoaut.com/“,

“Resource=0“,

“RecContentType=text/html“,

“Referer=”,

“Snapshot=t1.inf“,

“Mode=HTTP“,

LAST);

If you set the Resource attribute to 1, then the resource will not be downloaded. You can check in the runtime viewer. Below is the output of runtime viewer.

List Non-Critical Resource Errors as Warnings in LoadRunner

List Non-Critical Resource Errors as Warnings in LoadRunner

List Non-Critical Resource Errors as Warnings in LoadRunner: Enabled or Disabled

From my opinion, all resources are CRITICAL. Assume that you are testing eCommerce related web applications, users buy products after viewing the product images. In this case, all the images are critical. On the other hand, if you are testing banking related web applications, where you do not care about the images present in the website, all you care is about the business functionalities and its response.

By enabling, List Non-Critical Resource Errors as Warnings in your load test might not reveal the performance bottlenecks of those RESOURCES.

In my experience, I recommend you to disable the default settings of List Non-Critical Resource Errors as Warnings checkbox for better performance testing.

Your turn: What is your load test setting List Non-Critical Resource Errors as Warnings in LoadRunner? Checked or Unchecked.

Please do check out my previous article on web global verification in LoadRunner.

About NaveenKumar Namachivayam

Hi there! is a passionate and experienced Performance Test Analyst based in Chicago, USA with skill sets in Manual Testing, Test Automation, Performance Testing, and Test Estimation. He loves to learn and experiment new trends and models in Software Testing. Please stop by at his personal blogs: Excel Blog, DealsBrook, NaveenKumarN.in, and Affiliate Insights blog and Software Testing Memes.

Leave a Reply

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