Web_find and Web_Image_check function are used to find the specified text in the response of the HTML page. This function is only support in HTTP/HTML protocol based script. You should need to make sure that do the following changes in the run time settings before you use these two functions.
Go to Vuser -> Run-time Settings
Go to internet Protocol -> PreferencesSelect the “Enable Image and Text Check” check box.
Web_find and web_image_check will throw an error if the text or image does not found in the response.
For example if you want to set error when some text found. Then use the following example.
Example:
web_reg_find("Text=404", "Fail=Found", LAST);
web_reg_find("Text=404", "Fail=Found", LAST);
If you do not want to throw an error regardless of the condition then use web_reg_save_param function with "Notfound=warning" option.
Example:
web_reg_save_param("NameCheck", "LB=Hi", "RB=Welcome to Loadrunner","Notfound=warning", LAST);
Web_find and web_image_check do not give the number of occurrences of the text/image. To find this we can use web_reg_find function. In web_reg_find we have “Save Count” option with this we can find out the totoal number of occurrences of text/image. web_find and web_image_check is only for HTTP/HTML scripts. web_reg_find can be used with both HTTP/HTML and URL based scripts.
Example:
web_reg_find("Text=loadrunner", "SaveCount=loadrunner_count", LAST);
No comments:
Post a Comment