Hi
I've just written my first script, and surprisingly it works really well.
The script runs through stress testing a UI application, at the start and finish of each section of the script I log the start and finish using a Timestamp, when all tests in the script are complete it loops back to the beginning and starts all over again.
Now my question, is there a way in the log file to indicate how many times each section of the script has looped through. The script can currently run in the region of 200 times.
Thanks for any help.
Logging test results in a loop
Moderators: Dorian (MJT support), JRL
Create a variable to be a counter, then increment that variable each time the loop starts. You can write the value of the variable to the log file or include it in the name of the file.
Code: Select all
Let>Counter=0
Label>Loop
Add>Counter,1
//do stuff
Writeln>Logfile,res,This is iteration number %counter%
//do other stuff
Goto>Loop
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Look in the help file (just hit F1 while on WriteLn):
You can get immediate help on any command just by hitting F1 while the cursor is on a command, or from the command builder.[/quote]WriteLn>file_name,result,line
Writes text to a text file. If the file does not exist it is created and the given line is written to it. If it does exist, the line is written to the end of the file. If the command was successful, result is set to zero. A non zero result means an error occurred.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?