What is the difference between the below two error handling techniques, which one can be opted for day to day scripting usage.
The main issue which I see while using "lrexit (second type)" error handling is in vugen for e.g. if I run 3 iterations for a script which should fail, in test results only the first iteration shows as failed the rest two iteration gets displayed as passed even though they get exited out of the code.
Please explain the better method to use and how to make sure the script doesn't proceed further when a text check fails.
Error handling technique 1:
********************************
web_reg_find("text=xxx", "savecount=xxxx", "fail=notfound")
AND
Error handling technique 2:
********************************
web_reg_find("text=xxx", "savecount=abccount")
if(atoi(lr_eval_string("{abcount}"))==0)
{
lr_error_message("the page failed to load");
lr_end_trnsaction("abcd",LR_FAIL);
lr_exit("lr_exit_iteration_and_continue",LR_FAIL);
}
lr_end_transaction("abcd",LR_AUTO);