What is web_find?

Please Like Us!!!

LoadRunner Interview Questions

Q: What is web_find?
A: web_find function searches a HTML page for a specified text. web_find is deprecated, web_reg_find is used instead. But still questions are asked about it in LoadRunner interviews.

Syntax:
int web_find( const char *StepName, Attributes and Specifications list, char *searchstring, LAST );

Example:
1)web_find(“StepName”,”expect=notfound”,”matchcase=yes”,”onfailure=abort”,”report=failure”,
“repeat=no”,”what=Googly”, LAST);
In above example web_find searches for text ‘Googly’. The various attributes in above example are explained here:
a) expect – This attribute defines when the text search would be successful. Default value is found, other possible value is notfound. In above example search would be considered successful when text ‘Googly’ is not found.
b) matchcase – This attribute defines whether the search is case sensitive or not. Possible values are ‘yes’ and ‘no’. In the above example search would be successful in case of match case only.
c) onfailure – This attribute defines the behaviour in case if the check fails. The only possible value is ‘abort’, in case this attribute is not specified the execution would continue on error.
d) report – This attribute defines when to display the results of the checks in Result Summary Report. Possible values are ‘failure’, ‘success’,’always’. Default value is ‘always’. In the above example the results would be displayed in Result Summary Report only in case the check fails.
e) repeat – This attribute defines whether the search should be continued once the first match is found. Default value is ‘yes’. The other possible value is ‘no’.
f) what – This attribute defines the text to be searched.

2) web_find(“Step Name”, “RightOf=Right Text”, “LeftOf=Left Text”, “What=Googly”, LAST );
In the above example web_find searches for text ‘Googly’ that lies between ‘Right Text’ and ‘Left Text’. RightOf and LeftOf attributes are used to specify the textual boundaries within which you want to perform the search.

Reviews & Comments

Enjoy!