Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

automating tests

by grashoper (Monk)
on Oct 30, 2008 at 18:25 UTC ( [id://720535]=perlquestion: print w/replies, xml ) Need Help??

grashoper has asked for the wisdom of the Perl Monks concerning the following question:

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

Replies are listed 'Best First'.
Re: automating tests
by grep101 (Initiate) on Oct 30, 2008 at 21:05 UTC
    There is a LR automation API called LrEngine that's accessible via Win32::OLE, check it up. You could check the status of each vuser by accessing the LrVuser.
      does this exist in loadrunner 8.1 fp4? thats the version I have, I don't have support via hp anymore and cannot really get help from anyone in the company on it, running vugen constantly causes drive to fill up with logfiles so I do need to kill the process but only after I have run through a certain amount of iterations. I did a google for lrengine but didn't find anything of use, I will check the 1200 page manual I have at work tomorrow morning though thanks for the tip.
        I coded LR Controller automation since 7.5 - 7.8, skipped 8. but using 9.1 now. I think 8 should have it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://720535]
Approved by Perlbotics
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-29 01:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found