01-25-2011 11:21 AM
I have about 300 different tests that I run using TestStand, each with a somewhat unique report output filename:
Example: 0-RMC 80 Timer_Interface_MaxValue_Report.html
The filename includes the
Number of Errors
Product Name
Build Revision
and a unique test name.
I would like to add a step to an existing initialization routine to test for an existing report file name and if it exists, bypass the test sequence.
The question is, how do I run a system command within TestStand to test for a file, for example:
If (SystemCommand(dir Locals.ReportPath\0-RMC 80 Timer_Interface_MaxValue*.html) then
Don't run this test...
Similarly, I also need to know how to delete a file from within TestStand.
SystemCommand(Del 9999*.*)
Mike
01-25-2011 06:03 PM
You can use the FindFile method in the TS API:
Engine.FindFile ( fileToFind, absolutePath, userCancelled, promptOption = FindFile_PromptHonorUserPreference, srchListOption = FindFile_AddDirToSrchList_Ask, isCommand = False, [currentSequenceFile])
The function itself returns a boolean which indicates if the file exists or not.
Then just use a Call Executable step to run command line string to delete the file.
Hope this helps!