Execute TestStand Sequence One by One Using Batch File

Updated Mar 15, 2024

Environment

Software

  • TestStand

TestStand is a powerful automated test management software developed by NI. It provides a flexible environment for creating, executing, and analyzing automated test sequences. 

This guide simplifies automating TestStand sequence file execution using batch scripting. 

  1. Create Sequence Files:
    • Create two sequence files named SequenceFile1.seq and SequenceFile2.seq.
    • In SequenceFile1.seq, add an Action step under the Cleanup section to generate a "Seq1Finished.txt" file in the same directory. This step will serve as an indication that the first sequence file has finished its execution.
    • You can download the sequence file for this example in the attachment.2024-03-14_13h54_15.png
2024-03-14_13h53_52.png
  1. Create a Batch File:
    • Create a text document in the same directory where your sequence files are located.
    • Open the text document using a text editor.
    • Copy and paste the following commands below into the document.
    • Save the text document with a ".bat" extension, such as Test.bat.
start /B SeqEdit.exe -useExisting -runEntryPoint "Single Pass" "C:\Users\NI-TSE\Desktop\TS\SequenceFile1.seq"

:wait_for_file
timeout /t 10 /nobreak >nul
if not exist Seq1Finished.txt goto wait_for_file

start /wait SeqEdit.exe -useExisting -runEntryPoint "Single Pass" "C:\Users\NI-TSE\Desktop\TS\SequenceFile2.seq"
 
  1. Run the Batch File:
    • Before running the batch file, you will see these files in your folder, SequenceFile1.seq, SequenceFile2.seq and Test.bat.
    • Double-click on the Test.bat file to execute it.
    • The batch file will run, initiating the SeqEdit.exe program twice, each time with a different sequence file. It will wait for the first process to finish before starting the second one. Additionally, it will check for the existence of the "Seq1Finished.txt" file before starting the second process.
2024-03-15_10h54_14.png

After the execution of both sequence files is finished, you will be able to view the report of your execution for each sequence file.

2024-03-14_14h03_08.png

Attachments