Verifications and Error Handling in LoadRunner *Web_reg_find and Web_reg_save_param*

Verification's and Error Handling

Verification points must be inserted into the scripts to verify the application being tested with the load.

Verification function that are used in our application are:  Web_reg_find, web_reg_save_param

These verification should be outside towards the end of the transaction.

         Login – whenever there is a login, verification points must be added to verify that the user logged in correctly.
         Update Transactions – transactions that update the database must be verified that they are successful.
         Each page should be verified using Web_reg_find function

Using Web_reg_find for verifications.

Example:
web_reg_find("Text= Main Package","SaveCount=Verify_Count1",LAST);

Verification:
if (strcmp(lr_eval_string("{Verify_Count1}"),"0")==0)
{
lr_end_transaction("AddMainPackage", LR_FAIL);
 lr_error_message("Iter %s: Add Main Package for Customer '%s' & UserName '%s' Failed!", lr_eval_string("{Iter}"), lr_eval_string("{CustomerName}"), lr_eval_string("{LoginID}"));
return 0;
}
Else
{
lr_output_message("Iter %s: Add Main Package for Customer '%s' & UserName '%s' Succeded!", lr_eval_string("{Iter}"), lr_eval_string("{CustomerName}"), lr_eval_string("{LoginID}"));
}

Using Web_reg_save_param for verifications.

Example:
  web_reg_save_param("OrdersJan",
                        "LB=OrdersJan:",
                        "RB=\"",
                        "NotFound=EMPTY",
                        LAST);

web_reg_save_param("OfferNode",
"LB=type=\"checkbox\" value=\" OfferJan:",
                        "RB=\"/>",
                        "NotFound=EMPTY",
                        LAST);
Verification:
if ((strcmp(lr_eval_string("{OrdersJan}"),"")==0)||
(strcmp(lr_eval_string("{OfferJan}"),"")==0)){
lr_end_transaction("NewConnect", LR_FAIL);
lr_error_message("Iter %s: Select New order Customer '%s' & UserName '%s' Failed!", lr_eval_string("{Iter}"), lr_eval_string("{CustomerName}"), lr_eval_string("{LoginID}"));
return 0;
}
Else
{
lr_output_message("Iter %s: Select New order Customer '%s' & UserName '%s' Succeded!", lr_eval_string("{Iter}"), lr_eval_string("{CustomerName}"), lr_eval_string("{LoginID}"));
}

         The verification should provide as much info on the problem accrued, for example printing the user details, order number that failed.
lr_error_message("Order Failed with User : %s ",lr_eval_string("{CurrUserID}"));

         A transaction must be ended by strictly specifying success or failure (LR_PASS, or LR_FAIL). Automatic detection must not be used (LR_AUTO).


Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Unless you smoke more than 2 grams a day, you should be fine using either product, but if you want to play it safe, you can always pair it up with a detox drink like Mega Clean. The instructions for each detox system are the same and can be found on the side of the jar: take three tablets at once, every 4-5 hours leading up to the day of your test. Then, on day 5 or 10, take half of the detox liquid after finishing the last three pills and the other half two hours later. Not everyone has the time it takes to spend hours applying shampoo in the bath. As you look for the best shampoo detox product for you, look through the instructions to see how long it takes to apply the product. One of the first things people do when buying a new product is assessing the reputation of the brand behind it. Visit: https://www.urineworld.com/

    ReplyDelete

Post a Comment

Popular posts from this blog

Steps to Analyze AWR Report in Oracle

Examples on Date and Time in LoadRunner