It is a well-known fact that LoadRunner simulates the real user and browser and generates the load on the server. When we say ‘simulate the real browser’, it means LoadRunner neither sends the request via real browser nor receives and loads the page like a real browser, so how to verify whether the specific page is loaded correctly or not?
To answer this question, LoadRunner has a provision called ‘Content Check’. ‘Content Check’ feature verifies the key content in the response of a webpage coming from the server. You can add these checks to the Vuser scripts to ensure the presence of a specific object (Text or Image) on a web page. The content check also helps to determine whether the website or application is functionally correct or not.
What are the types of content check available in LoadRunner?
At which point content checks are added in the script?
The content check can be added:
- While Recording the script (Text Check)
- After Recording the script in debugging phase (Text and Image Check)
What are the functions of ‘Content Check’?
- web_find (Deprecated)
What is the purpose of ‘content check’ in LoadRunner?
When you record the script or execute it with a single user then the server may send the correct response for a web request. But the case may be inverse under user load condition. The server may send an incorrect response due to failure of the application when a heavy user load is applied. In such a case, the server is overloaded and returns a meaningless response. Similarly, in some instances server returns 5XX (like 500, 503) HTTP status error page. To handle both cases, you need to insert a check to determine the correctness of the response. That check refers to the ‘Content Check’ of LoadRunner script.
How to choose text or image for the content checking in LR?
You can choose an image, text or text-string as a content check which is unique on the page or in the body of the server response. If a webpage is divided into many frames then choose the text or image appeared in the latest updated frame. Welcome message, Page Name, Order Number text are some of the text checks whereas Company logo, Page image, static graph image are the example of image check.
Can we apply multiple content checks on a page?
A text or image check increases LoadRunner work which may reduce the number of Vusers generated by a load generator. Although the impact is very minimal. Hence it is advisable to use only one content check for a page or where experience has shown that the server sometimes returns an incorrect page. From the performance perspective, more preference is given to the ‘text check’ than ‘image check’ so add ‘image check’ only where it is really needed.