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. New Zealand's healthcare system is welcoming qualified nurses to join its ranks, offering a competitive and fulfilling career opportunity. Candidates must possess recognized nursing credentials and have a proven track record in patient care. The role emphasizes teamwork and cultural sensitivity, as nurses work with diverse communities across the country. Fluency in English and excellent interpersonal skills are mandatory for effective communication. The position provides competitive salaries, ongoing professional development, and access to state-of-the-art medical facilities. Nurses will experience both career progression and the chance to live amidst New Zealand's stunning natural landscapes. This opportunity promises not just professional advancement, but also a vibrant lifestyle. Qualified applicants are encouraged to explore this rewarding career path in a welcoming and dynamic healthcare environment.
    https://www.dynamichealthstaff.com/nurse-vacancy-in-new-zealand

    ReplyDelete

Post a Comment

Popular posts from this blog

Steps to Analyze AWR Report in Oracle

Vmstat Output explained