Friday 4 May 2018

Page Validation Using Load Runner - Part2 - Chapter11



  • Continuing Page validation from Part1-Chapter11..
  • The text which we picked to compare with response body, if it is converted to Capital letters or small letters.Then the error messages would be thrown as text not found. 
  • Hence to overcome this, we can use additional attribute("IC") to suffix the attribute "Text=". Example : web_reg_find("Text\IC=Welcome Yasir", "SaveCount=TxtChk_Login", LAST);
  • We have two ways to add web_reg_find. 
    • One is by typing the code manually
    • The second one is by following below
      • vugen--> Right click on Request-->Show Snapshots --> Replay-->Page View -->Drag and Select the text from web page that needs validation-->Right click on the selected text --> Select "Add Text Check Setup" --> Modify Text Check settings and click OK.

  • To view the number of occurances of the SaveCount in output log, we need to enable Log prior to it. Run time Settings-->Log-->Extended Log-->"Parameter Substitution".
  • Once SaveCount value is found, based on it, we can write customized page validation code below to validate webpage. if the expected page is not loaded, then we will fail the transaction with customized error message as expected page is not loaded.
  • web_reg_find("Text=jojo",
            "SaveCount=TxtChk_Login",
            "Fail=NotFound",
            "Search=ALL",
            LAST);
  • if(atoi(lr_eval_string("{loginChk}"))==0)
        {
                lr_end_transaction("UC01_Webtours_Login_01_Login",LR_FAIL);
                lr_error_message("Login Failed for %s",lr_eval_string("{p_LoginUser}"));
                lr_exit(LR_EXIT_ITERATION_AND_CONTINUE,LR_FAIL);
        }
        else
        {
        lr_end_transaction("UC01_Webtours_Login_01_Login",LR_AUTO);
        }
  • Stay tuned for more leanings.

No comments:

Post a Comment

Correlation Using Load Runner - Part1 - Chapter13

Correlation General Description : Capturing Dynamic values from the preceding requests and substituting in the post request.  Exam...