Invoking a batch file using Loadrunner

587 views
Skip to first unread message

Sahil

unread,
Sep 24, 2009, 5:40:04 PM9/24/09
to LoadRunner
Dear Friends,

I have used system() command to invoke batch file using loadrunner.
The batch file is an executable batch file (Plink.exe) and I have
invoked it using the following command.

system("c:\\Plink.exe");

when I run the command using loadrunner the batch file flashes on the
screen for a second and closes, please help me in understanding that
how can I know that the batch file is running successfully or not.

Below given command is used to remotely execute the sql statements on
the DB server:

plink -l root -pw <root password> 10.2.201.144
export ORACLE_HOME=/u000/app/oracle/prod/10.4.2.1/DB/ ;
export PATH=$PATH:/u000/app/oracle/product/10.4.2.1/DB/bin;
sqlplus <connection string> @/tmp/<sql script name>

For the above command to execute on loadrunner I have created a batch
file with name sql.bat, which includes the above command and I am
executing is using system command.

system("c:\\sql.bat");

This is my understanding of executing a batch file using loadrunner,
please correct me if I am doing it wrong and suggest me the correct
method.

Any help in this regard is appreciated.

Regards,
Sahil

ebu...@gmail.com

unread,
Sep 26, 2009, 2:28:39 AM9/26/09
to LR-Loa...@googlegroups.com
you can try the RTE protocol to record the script, but you need to ensure that you have the license for this protocol.
 
In addition, I do not think it's a smart decision to use loadrunner to execute the batch file.
please try to code the shell script or batch script to measure the performance of the batch files.
Bob. Li
 
Performance Analyst
2009/9/25 Sahil <niya...@gmail.com>

Jitendra Nath

unread,
Sep 27, 2009, 9:23:57 AM9/27/09
to LR-Loa...@googlegroups.com
Hi Sahil,
 
       To my guess, some error is being displayed in the batch file execution window before it is closed i.e in the cmd prompt window. Insert a PAUSE statement at the end of the batch file sql.bat. First we need to find out what error is displayed in that window. So that we can find the root cause of the problem.
 
By the way, did you place the PLink.exe file available at the given path in the batch file? Is this execution problem, on a VuGen machine or a Controller machine ? if it is on a Controller machine make sure that files are available on the controller machine also at same path given in the batch file. (ha ha ha)

Let me know the outcome.
 
Thanks,
Jitendra Nath.

Sahil

unread,
Sep 27, 2009, 2:31:30 PM9/27/09
to LoadRunner
Hi Jitendra,

I have placed the Plink.exe in the given path and the execution
problem which I am getting is in VuGen not in controller,
I have inserted the PAUSE statement in the sql.bat batch file and
after execution it is asking for press any key to continue, but the
Plink.exe file is provided by development team and I cant place PAUSE
statement in Plink.exe.

Please let me know that the method which I am following to invoke
batch file is correct or not. If I am on the right way then please
advise me how to design scenario for this.

Kindly let me know if you need more details.

Any help in this regard will be appreciated.

Regards,
Sahil
> > Sahil- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages