LoadRunner ContentCheck Rules
A LoadRunner feature that has made my life a lot easier has been ContentCheck rules, which are available in the script runtime settings. 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.
I will always create rules for any error messages I find during scripting and, if I receive an error while running a scenario, I will add the error message from the snapshot in the scenario results directory (the snapshot on error feature is very useful).
All this is pretty obvious if you have taken the time to explore LoadRunner’s features or you have attended a Mercury training session, but I recommend taking things a step further.
- 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.

January 19th, 2007 at 8:31 am
Stuart, asking the developers for a list of error messages can be an ordeal and might require an act of congress. Our developers are all scattered trhoughout the planet. I found that writing to the log is much better in my case:
lr_fail_trans_with_error(”%s %s %s %d %s %s %s %s %s %s %s %s”,
lr_eval_string(”{success_msg}”),
lr_eval_string(”{JSESSIONID}”),
lr_eval_string(”{service}”),
searchparam,
lr_eval_string(”{SearchModeParm}”),
lr_eval_string(”{cityParm}”),
lr_eval_string(”{stateParm}”),
lr_eval_string(”{airportParm}”),
lr_eval_string(”{poiNameParm}”),
lr_eval_string(”{poiStateParm}”),
lr_eval_string(”{leavingDate}”),
lr_eval_string(”{returningDate}”));
as you can see from success_msg parm, that what they called their error message. I can’t imagine asking them to use any error handling method.
Yours in performance,
Jose Villarreal
August 29th, 2007 at 10:10 pm
Hi !
I need 2 understand better on this Content Check topic. Can u kindly share it with me….?
Kindly send ur mail id….
Thanks in advance.
March 17th, 2008 at 7:29 pm
Hi
I am a Load Runner agent(He he). This is a good information to solve the problems while executing the script. I was a bit confused when I am getting the errors @ run time. Now I am on the page.
Thanks
Arif.
March 26th, 2008 at 7:37 pm
hi guys
i am working on loadrunner i need to know more details of content check plz help me
April 2nd, 2008 at 8:54 pm
hi
this is suren
can u help me for understandig abt contentcheck in runtime settings.
and how to do correiation for the script…………
hope u send me mess
thanking u