How to link the data generated in one script to another

301 views
Skip to first unread message

Venkat M

unread,
Dec 2, 2009, 5:24:32 PM12/2/09
to LoadRunner
Hi,

Can anyone help me on the following

I created four separate scripts

1.Creation of Requisition
2.Creation of PO
3.Creation of Receipt
4.Creation of Vocher.

I can create PO(Script#2) by taking the requisition id which is
generated from Creation of Requisition(script#1).
Like that 3rd script will run based on the output of 2nd script and so
on.
Can anyone suggest what to do in this case? Please mail me the sample
code.

Thanks,
Venkat.



James Pulley

unread,
Dec 4, 2009, 3:19:01 PM12/4/09
to lr-loa...@googlegroups.com
Virtual Table Server. Use your maintenance contract to download this piece
of software which will act as a broker to pass information from one script
to another. Sample code is included in the documentation for Virtual Table
Server (VTS). Plan for 2x to 3x development time once comfortable with VTS,
like 5x-10x until then.

You will be unable to write to the data file of script A from Script B while
a test is ongoing and have the changes reflected in your pool data for
Script A.
--
You received this message because you are subscribed to the Google
"LoadRunner" group.
To post to this group, send email to LR-Loa...@googlegroups.com To
unsubscribe from this group, send email to
LR-LoadRunne...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/LR-LoadRunner?hl=en

chaitanya bhatt

unread,
Dec 4, 2009, 7:57:19 PM12/4/09
to lr-loa...@googlegroups.com
In most cases VTS will help in such scenarios, but there is a catch.
 
Since scripts are dependent on successful completion of other scripts in this scenario, if one scripts from top of the hierarchy fails the rest would also fail during execution. Adding to this issue, in some cases to increase the total concurrent user count you will have to run all the scripts simultaneously rather that running it sequentially.
 
Solution: As a part of data creation process, run these scripts individually and dump the data into a file or extrapolate it directly from the database. Once you have created data, place the data in all the scripts and then execute them. this way, even if the 1st script fails during execution 2nd,3rd and 4th fourth can still continue because they already have whatever data is required for them to run.
There is another workaround if you do not have exp using vts table: Combine script 1,2,3,4 into one script by placing each script into different "actions" of the same script. Now correlate the data from each action to the next action( i.e. from 1st to 2nd and so on and so forth).Then again, if action 1 fails action 2,3,4 would fail and the virtual user would fail during execution.
 
I prefer the approach mentioned in the beginning. Wish you the best!
 
Regards,
Chaitanya M Bhatt

Floris Kraak

unread,
Dec 5, 2009, 7:54:49 AM12/5/09
to lr-loa...@googlegroups.com
On Sat, Dec 5, 2009 at 1:57 AM, chaitanya bhatt
<bhatt.c...@gmail.com> wrote:
>
> There is another workaround if you do not have exp using vts table: Combine
> script 1,2,3,4 into one script by placing each script into different
> "actions" of the same script. Now correlate the data from each action to the
> next action( i.e. from 1st to 2nd and so on and so forth).Then again, if
> action 1 fails action 2,3,4 would fail and the virtual user would fail
> during execution.

I actually prefer this approach to the others. Resort to VTS only when
absolutely needed.
The reasoning about this is simple: If step 1 fails to generate data,
it would do so in real life as well. So why try to 'work around' what
happens on a real server too?

Of course that presumes there are no scripting errors getting in the
way, but my scripts tend to be fairly robust ;-)

You may have to use some coding to reset your caches and such in
between steps though, if you have multiple login/logout procedures
linked in sequence ..


Regards,
Floris
---
'What does it mean to say that one is 48% slower? That's like saying
that a squirrel is 48% juicier than an orange - maybe it's true, but
anybody who puts the two in a blender to compare them is kind of
sick.'
--- Linus Torvalds

John Crunk

unread,
Dec 5, 2009, 10:56:24 AM12/5/09
to lr-loa...@googlegroups.com
I actually have never had to link to a database. If you correlate
properly it avoids this

John Crunk Ph.D ABD
Sent from my iPhone

Deepak Gupta

unread,
Dec 5, 2009, 4:59:46 PM12/5/09
to lr-loa...@googlegroups.com
I have a query, how can we calculate databse overhead, in case we go with VTS  and use database connection to populate vts table?

-Deepak

John Crunk

unread,
Dec 5, 2009, 5:35:49 PM12/5/09
to lr-loa...@googlegroups.com

This is one of the problems with doing it this way. That is one reason I don’t do it. What keeps you from writing poorly formed queries that have extra overhead? Don’t do it this way, do it right and you will be fine.

 

John

Luca.C...@cedacri.it

unread,
Dec 9, 2009, 3:09:00 AM12/9/09
to lr-loa...@googlegroups.com
Return Receipt

Your RE: How to link the data generated in one script to another
document:

was Luca Cattaneo/Cedacrinord_Spa/IT
received
by:

at: 09/12/2009 09.09.02





Reply all
Reply to author
Forward
0 new messages