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..
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.