Performance Center Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

VUgen: continue transaction after timeout

Highlighted
Occasional Contributor

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
2 REPLIES
Valued Contributor Valued Contributor

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 Trusted Contributor

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