VUgen: continue transaction after timeout (282 Views)
Reply
Occasional Contributor
Andrea Mogni
Posts: 4
Registered: ‎03-10-2011
Message 1 of 3 (282 Views)

VUgen: continue transaction after timeout

Hi all,
I'd like to write a script in which transactions are set as PASSED even if a NON-HTML resource download could lead to a timeout.

Any suggestions?

Thanks a lot,
Andrea
Valued Contributor
Archanak
Posts: 55
Registered: ‎01-11-2011
Message 2 of 3 (282 Views)

Re: VUgen: continue transaction after timeout

Hi,

You can achieve that by changing the following Run-Time Setting:

Preferences > Uncheck Non-critical resource errors as Warnings

Alternatively, you can use custom coding as below:
Get the return value for the resources. If it is 0, then pass the transaction, else fail it

-------------------------------------
int retValue;
lr_start_transaction("test");

retValue = web_submit_data("...resource..");
web_url("...non-resource...");

if(retValue == 0)
lr_end_transaction("test", LR_PASS);

else
lr_end_transaction("test", LR_FAIL);
-------------------------------------

Hope this helps

Archana
Trusted Contributor
Srinivas Motamarri
Posts: 146
Registered: ‎03-17-2011
Message 3 of 3 (282 Views)

Re: VUgen: continue transaction after timeout

Hi,

You can design your script in such a way to exit the iteration at a certain point where a specific text is found(such as a page title or some specific text) and then continue with next iteration. which may not lead to pause or stop your script and then continue.
Make use of the following code to solve your issue :
web_reg_find("text=google","savecount=cnt",LAST);
lr_start_transaction("google__T001_homepage");
if(atoi(lr_eval_string("{cnt}"))>0
{
lr_end_transaction("google__T001_homepage",LR_PASS);
}
else
{
lr_end_transaction("google_homepage",LR_FAIL);
lr_exit(LR_EXIT_ITERATION_AND_CONTINUE,LR_FAIL); // this stmt makes the users to continue even if transaction fails
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.