Need to call VB Script to Load Runner

97 views
Skip to first unread message

DeeApps

unread,
Jul 22, 2011, 11:46:17 AM7/22/11
to LoadRunner, pk00...@gmail.com
Hi,

I am using the VB script to pump the couple of transactions into A
folder to B folder.

I can call this .VBS file in Windows scheduler and it will run on
specific timings.

Now i want to do this thru Load Runner than Windows scheduler.

I tried to keep the vb script in LR VB Script Vuser Protocol and ran
it, but i am getting some errors..


This is the script i am using for general Pumping which working in
WIndows scheduler and not working in LR VBSCRIPT VUSER.

Action()
{

set fso = wscript.createobject("scripting.filesystemobject")
set ls = wscript.createobject("scripting.filesystemobject")
set ws = wscript.createobject("wscript.shell")

randomize(Timer)

Dim runflag
Dim newfilename
Dim filectr
Dim fname
Dim mypos
Dim rfname
runflag = true
filectr = 0


Set f = fso.GetFolder("C:\Documents and Settings\Desktop\A")
Set t = ls.OpenTextFile("C:\Documents and Settings\Desktop\Logs\A.txt",
8, true, TristateFalse)
t.WriteLine (Date & " " & Time & " ----- Transactions Start -----")

Set fs = f.Files
On Error Resume Next

For each fl in fs

fname = fl.name
rfname = Right(fname, 3)
if rfname = "278" or rfname = "txt" or rfname = ".in" Then
t.WriteLine("pumptxn -p9082 127.0.0.1 " & fname)
ws.Run("pumptxn -p9082 127.0.0.1 " & fname)
Wscript.Sleep(1000) 'every 1 seconds
fl.Move("C:\Documents and Settings\Desktop\B\" & fname)
't.WriteLine("File " & fname & " moved to destop\B")
end if
Next


t.WriteLine(Date & " " & Time & " ----- processed transactions
-----")
t.WriteBlankLines 2

t.Close
set ls = nothing
set fso = nothing
set ws = nothing
wscript.Quit

return 0;
}


Error: Error: Error : Action.vbs (12) : column 0 : Object required:
'wscript' , err # = 424
Does any one suggest me here please.






Thanks,

Abhishek Banginwar

unread,
Jul 22, 2011, 12:19:41 PM7/22/11
to lr-loa...@googlegroups.com
have you loaded the required dlls to do so?


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



--
Abhishek

pradeep kumar

unread,
Jul 22, 2011, 12:24:26 PM7/22/11
to lr-loa...@googlegroups.com
NO Abhishek, Do we need to install VB in my machine?

If this is not the way, do we have any alternative for this?
 
 
 
 
 
 
Thanks & Regards,
Pradeep Kumar K

James Pulley

unread,
Jul 22, 2011, 1:04:09 PM7/22/11
to lr-loa...@googlegroups.com

You may want to restructure your thoughts when running as a part of a scenario.   Date and time will be captured automatically if you use a datapoint.   Datapoints also flow back to the controller for consolidated collection and analysis as a part of your performance test.

 

James Pulley, http://www.loadrunnerbythehour.com/PricingMatrix

John Crunk

unread,
Jul 22, 2011, 1:04:36 PM7/22/11
to lr-loa...@googlegroups.com
Read the message and script again. You script won't work for 2 reasons

Thanks,

Dr. John Crunk
Sent from my iPhone

Abhishek Banginwar

unread,
Jul 22, 2011, 1:08:59 PM7/22/11
to lr-loa...@googlegroups.com
like i said, you require dll to use proper vb functions. if you want to, you can install vb, write and compile your code there.
copy to loadrunner and add loadrunner functions and use parameters.

anyways why would you like script in vb user?

K PRADEEP

unread,
Jul 22, 2011, 1:22:45 PM7/22/11
to lr-loa...@googlegroups.com
Thank you James,
 
i will do that, and is this the correct way i am thinking to call the VB SCript to the VUGEN?
 
is it possible to do or do we have any other ways to do bit faster?
 
Thanks

Thanks & regards,
Pradeep Kumar K

K PRADEEP

unread,
Jul 22, 2011, 2:08:37 PM7/22/11
to lr-loa...@googlegroups.com
Thanks Abhi,
 
Not specific about VB User,  This VB script will process the thousands of files by doing 1 hr schedule in Windows scheduler, same thing i want to do by using LR. I just want utilize LR in Optimum.
 
If there are other way's  also good. I aim to run these files thru LR.
 
Thank you,

James Pulley

unread,
Jul 25, 2011, 10:02:08 AM7/25/11
to LoadRunner
For me I would probably rewrite the algorithm in C just to allow me to
use just about any virtual user type I want for the execution. As
noted previously I would use the LoadRunner engine for collecting
information on time required or other data point information for
analysis purposes. Given that your error seems to be pointing to a
specific line I would be looking at that area, or the lines preceding
that area, as the source of the error.

James Pulley, http://www.loadrunnerbythehour.com/PricingMatrix
Reply all
Reply to author
Forward
0 new messages