I have some loadrunner scripts I am trying to set to start & stop automatically. I not only want to stop the lr process if it has completed, but I also want to check and see if it is hung for a long period of time and if it does hang setup notification so that I don't get blindsided by someone asking for data that it failed to capture. I know very little perl, and am not sure if I can get this to work. I apologize for the length of this post but here is what what I have so far.
this is using a combination of vbs and perl. test.vbs starts the test..
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "E:\MIBOR_TimingTest\MIBOR\mibor.usr", 9
' Give loadrunner time to load
WScript.Sleep 500
' Do The Paste
WshShell.SendKeys "{F5}"
step 2 is to check for the existince of string=Vuser Terminated. in output.txt a file generated by the loadrunner test, if found it should kill loadrunner and then restart it.
finally I wanted to account for hangs but not sure how to do that.
so I call find.pl if I can figure out how to that is.
#!/usr/bin/perl
use win32::OLE qw(in);
$search="Vuser End";
open(INFO, "E:\\Mibor_TimingTest\\Mibor\\output.txt");
@array=<INFO>;
close (INFO);
foreach $line(@array){
if ($line =~ /$search/)
{
do this stuff etc..
}
#Here I need to call killp.pl with arguments..again not sure how to do this from within a perl script.
#Here I may need to add some code to check how long has #this been going on if too long then send me an alert etc..