Sunday, March 8, 2015

Lr_Content Check_v0.1

LoadRunner provides at least 4 ways to ensure to that  response we get meets our expectation. 

Web_reg_find. This function has to be placed before the request which needs to be validated for right response. Web Reg Find has got lot of attributes which can help us to find the right text. It is basically a service function of LR. This functions scans the entire server response to check if the required text is present or not. It can also be inserted while recording the business flow with LoadRunner.
Web Global Verification : This function is similar to web reg find function with only difference that it searches the text in every subsequent response received for each request. If the text is found, then required action is taken. It is global in scope and applies for entire script.
Content Checks : LoadRunner provides the mechanism for validating the response for right content. Content checks can be enabled from the run time setting of the LoadRunner scripts. Once enabled and when script is ran, setting are directly loaded along with script in the LG’s ram. This speeds up the execution time of the script.
Correlation Functions : Web reg save functions can also be used for text checks in certain cases.

 

Load Runner Content Check

If you are using a web-based vuser type, you can configure your LoadRunner script to search through all returned pages for strings that match known error messages. Using web_reg_find functions is fine, but when you get an error LoadRunner reports it as “failed to find text” instead of something more descriptive.

  • Ask your developers for a list of all the error messages that the application can throw. This should be easy for them to provide if the application is well designed and stores all the message in some kind of message repository instead of sprinkling them throughout the source code.
  • Include error message for functional errors that you are likely to encounter. Creating a rule for “incorrect username or password” may save someone 20 minutes of investigation when they first run the script after the database has been refreshed.

If you prefer to have error message you are checking for in the script (where you can add comments to them) instead of the runtime settings, you can use the web_global_verification function instead. The only difference between the two is the error message that LoadRunner will include in its log:
Action. c(737): Error -26368: “Text=A runtime error occurred” found for web_global_verification (“ARuntimeErrorOccurred”) (count=1), Snapshot Info [MSH 0 21]
…compared to:
Action. c(737): Error -26372: ContentCheck Rule “ARuntimeErrorOccurred” in Application “Webshop” triggered. Text “A runtime error occurred” matched (count=1), Snapshot Info [MSH 0 21]
And finally, ContentCheck rules can be easily exported and shared between scripts, which can be a nice time-saver.

References: 1). myloadtest. com  2). easyloadrunner. blogspot. in 3). softwareworker. wordpress. com
 
Note: Some of the articles are grab from various Websites / Blogs.

No comments:

Post a Comment