Highlighted
Absent Member.
Absent Member.
815 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
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

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
0 Likes
Highlighted
Absent Member.
Absent Member.

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
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.