Changes to the community structure and the menu bar
Significant changes have happened to the structure of our community and our drop down menu bar. READ ABOUT IT HERE
Performance Center User Discussions
cancel

vugen scripting help required

parkar Acclaimed Contributor..
Acclaimed Contributor..

vugen scripting help required

Hi experts,

we are using bac8.05 we have created script for one of our critical applications using vugen 9.5.agenda to this is that total 4 transactions in the script..how should i acheive the below functionalities/logic in the scripts

suppose if script fails than it runs again as soon as fail also in pass conditon it normally execute..script running interval 15 mins in bpm

Thanks
Cheers!

Nvr Blame a day in ur life....... Good day gives "happiness" & Bad day gives "experience" ......
8 REPLIES
Rajasekhar Gund
Absent Member.

Re: vugen scripting help required

Hi Parkar,

Can you brief the required situation in more details please, if none of the below scenarios is your actual requirement.

1. Even if any step/transaction fails out of the four transactions, the script should continue running & execute normally till the last step.
- For this you can use "Continue on error" option in run-time settings of the script.

2. If there is any error occurred in any of the step/transaction the script should start running from beginning as a fresh run again.

- For this you need to use labels & goto function. Define a label at the start of script & at the place where an error is possible, create a if condition for identifying if error has occurred & if error has occurred use goto command to route the flow to the label defined at start of the script.

This has to be used with caution, as using it in 2nd or 3rd or 4th transactions will create ambiguity of transaction to BPM & in worse case, the loop never ends if the error match occurring in each run.

In few scripts this will work even without selection of the "Continue on error" option but in break even situation it has to be enabled.

Let me know if I misunderstood you.

Thanks,
Raj

Regards,
Raj

Like this Post? Click Kudos! to show appreciation.
Is your issue addressed? Click "ACCEPT AS SOLUTION" against the post which helped you the most.
parkar Acclaimed Contributor..
Acclaimed Contributor..

Re: vugen scripting help required

Yes Raj..

First thanks for the response..

I am looking for second option

2. If there is any error occurred in any of the step/transaction the script should start running from beginning as a fresh run again.

Also regarding first run of the error encoutered is should not consider in bpm/bac reports.

The agend to this is it helps in false alerting of the scripts..

I didnt get your statemnt defining a lable at place where error is possible ?

How can we consider whther error is possible or not..may be i am considering wrong..

It will be really appreciate if you explain the same with small exmple..it will be really helpful

Thanks in advance

Cheers
Cheers!

Nvr Blame a day in ur life....... Good day gives "happiness" & Bad day gives "experience" ......
Rajasekhar Gund
Absent Member.

Re: vugen scripting help required

If there is any error occurred in any of the step/transaction the script should start running from beginning as a fresh run again.
Raj: Yes, the mentioned scenario servers the purpose, but it will not be considered as a fresh run. It will be considered as same run due to looping. Let's say if you have an error in 2nd transaction of a script containing 5 transactions, then by looping it will again run from beginning which counts as 5 transactions. 4 (new) + 1( first transaction which is already passed). For the first transaction two runs will be there in the single BPM run.

Also regarding first run of the error encoutered is should not consider in bpm/bac reports.
Raj: Error can be made ignored by not ending the transaction having the error & looping it to run again.

The agend to this is it helps in false alerting of the scripts..
Raj: I understand, but be sure, that it will not end up in a infinity loop.

I didnt get your statemnt defining a lable at place where error is possible ?
Raj: Refer goto statement in Function Reference help manual of VuGen. Any how I have explained below.

How can we consider whther error is possible or not..may be i am considering wrong..
Raj: It can be directly considered from transaction status, but if you have any specific condition match to be considered as an error, that is also possible.

It will be really appreciate if you explain the same with small exmple..it will be really helpful
Raj: Please see below.

Regards,
Raj

Like this Post? Click Kudos! to show appreciation.
Is your issue addressed? Click "ACCEPT AS SOLUTION" against the post which helped you the most.
Rajasekhar Gund
Absent Member.

Re: vugen scripting help required

Sorry missed the sample script. Please see below.

int status;

lr_start_transaction("111");

status:

web_url("xxxxxxxx, LAST );
web_url("xxxxxxxx, LAST );
web_submit_data("xxxxxxxx, LAST );

if (lr_get_transaction_status() == LR_FAIL)
{
goto status;
}
lr_end_transaction("111", LR_AUTO);

lr_start_transaction("222");

web_url("xxxxxxxx, LAST );
web_url("xxxxxxxx, LAST );
web_submit_data("xxxxxxxx, LAST );

if (lr_get_transaction_status() == LR_FAIL)
{
goto status;
}
lr_end_transaction("222", LR_AUTO);

Hope this helps. Let me know if you need any further help.

Thanks,
Raj

Regards,
Raj

Like this Post? Click Kudos! to show appreciation.
Is your issue addressed? Click "ACCEPT AS SOLUTION" against the post which helped you the most.
oneoff
Absent Member.

Re: vugen scripting help required

What is the objective here? Are you trying to test your application to make sure it is performant or are you trying to just get a test run complete with a clean report so you can tick a box?

If you are getting errors then address them, if they cannot be addressed then state this fact in the report - don't put in god awful goto loops just so you can present a clean report (a faux one by the way) at the end of your test.

How do you know that by putting this loop in you test that you will not change the entire load profile and end up spamming you server with 10s of thousands of invalid requests? You might not even see it in your reports!

Also, LR will give you built in functionality to handle what happens when a transaction fails. You should use this instead of trying to code the logic yourself. Lots of very good programmers have worked long and hard to allow you to do what you need - it makes no sense to ignore that and use a bunch of dangerous goto statements instead.

Try looking at breaking your requests into different actions. Try using the lr_exit function with different exit options. Try to avoid using continue_on_error. Try to fix the root cause! Try to avoid using goto statements, EVER, they are a very, very bad idea - at least use a while statement, do that at least.
Rajasekhar Gund
Absent Member.

Re: vugen scripting help required

@oneoff.

you are right to some extent but one solution can't fit all situations & all customers doesn't expect you to deliver the same baby every time. As said, goto statement is a dangerous infinity loop, but even that can be broken by using declared variables. Anyone can blindly record applications with VuGen & present to customer that it is what application is showing but dynamic paths have to handled in THIS way only, if we have to deviate from the default path. That is where the actual knowledge shines against to the copy-paste knowledge.

@parkar, though I have designed & already used this script for my requirement, use it it at your own risk with caution as you may end up in infinity loop. Be sure about what you are doing before committing something.

Still any issues or questions, feel free to post here.

Thanks,
Raj

Regards,
Raj

Like this Post? Click Kudos! to show appreciation.
Is your issue addressed? Click "ACCEPT AS SOLUTION" against the post which helped you the most.
Rajasekhar Gund
Absent Member.

Re: vugen scripting help required

Hi Parkar,

Please close the thread if your issue is fixed. If still have any issues or need any further help, post it here.


Thanks,
Raj

Regards,
Raj

Like this Post? Click Kudos! to show appreciation.
Is your issue addressed? Click "ACCEPT AS SOLUTION" against the post which helped you the most.
Pratim C Frequent Contributor.
Frequent Contributor.

Re: vugen scripting help required

Thanks for your suggestion. Your sample script helped me to fix my scripting problem.

Top Contributors Last 30 Days