NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

command line options / API Support to launch the sequence file

does teststand support any command line options / API Support to launch the sequence file and also populate the test run status. I want to explore the option of integrating the teststand with QC where I can launch the sequence from QC and results are sent back to QC.

 

Thanks in advance,

  -Dilip

0 Kudos
Message 1 of 10
(6,221 Views)

Hi Dilip,

 

Here are the command line options for TestStand v4.2.1:

 

---------------------------
Command Line Processing
---------------------------
Command line usage:

   seqedit.exe [<sequence file>]
               [/goto <location>]
               [/run <sequence> <sequence file>]
               [/runEntryPoint <entry point> <sequence file>]
               [/quit]
               [/setCurrentDir]
               [/useExisting]              
               [<workspace file>]
...

      <location>:  property object path to the item to display in the file
               Location examples:
                     TestExec.exe c:\example.seq /goto "Seq[\"MainSequence\"].Main[\"Power On\"]"
                     TestExec.exe c:\example.seq /goto "Seq[\"MainSequence\"].Main[\"ID#:JifH4ODTf0y1z7bJne0G7D\"]"
                     TestExec.exe c:\example.seq /goto "Seq[1].Main[4].TS.LoadOpt"

      <sequence file>:  sequence file to open
      <sequence>:       sequence to run
      <entry point>:    entry point, such as Single Pass or Test UUTs, to run
      <workspace file>: workspace file to open

   You may specify multiple sequence files, sequences, and entry points.

   Quotes are required for arguments that contain a space, such as
   "Test UUTs" and "C:\My Documents\Test Sequence.seq"

 

I don't believe you'll get a return status of the executed sequence from the editor on close; but you could design your sequence to write the status to a file and then read that by your QC application.

 

-Jack

0 Kudos
Message 2 of 10
(6,220 Views)

Hi Jack, I'm trying to setup a similar system as Dilip and can actually execute my sequences from the command line. However, I can't seem to be able to store the output to a file using the following statement

 

start TestExec.exe -run MainSequence "C:\Accurev\XC Automation Project NI Teststand\Software\Code\Project - Sequences\Src\Data Driven Test Sequence.seq" -useExisting -outputToStdIO -quit > report.txt 

 

After executing the above command, I get returned back to the prompt and can continue typing more commands. Once the test sequence is completed, I get a status on a different prompt line, which looks something like this. 

 

C:\Program Files (x86)\National Instruments\TestStand 2012\UserInterfaces\Simple\C++ using MFC\Release>Execution 'MainSequence - Data Driven Test Sequence.seq [2]' ended
Status: Passed

 

Do you know if there's anyway to redirect the output to a file? Also can I generate a Test Report using command line execution?

 

Thanks,

 

Yash 

0 Kudos
Message 3 of 10
(6,044 Views)

Hi Yash,

 

What are you expecting as output for your report? Your command is executing steps in the MainSequence without using an entry point, so unless the steps in your main sequence write something to a file that you access outside of TestStand, the step results of the execution are discarded when it exits the MainSequence.

 

As for what you can do with command line control of TestStand, what you see in my previous post is all there is, at least through v4.2.1. If you run your sequence via an Entry Point, it will generate a report (based on the process model & report settings you're using) that you can then access.

 

-Jack

Message 4 of 10
(6,027 Views)

Hi Jack,

 

I'm now checking for Errorlevels instead of writing the output the file, that did the trick to help me figure out the outcome of my test resullts. 

 

For the report generation, my MainSequence uses a sequential process model that has a testreport callback.

I was wondering how to change the process model which is associated with other sequences in the sequence file so that when I execute a sequence which is not the MainSequence, it generates a report as well.

I found out how to do this by setting up entry points, but it seems to be  unneccessarily unreasonable to do this for every single sequence in my sequence file. Can I just edit a single process model somewhere so that a report is generated for all of the sequences?

 

Thanks,

 

Yash

0 Kudos
Message 5 of 10
(6,009 Views)

I think using the "start" keyword on the commandline might be causing problems for you. Not sure why you are using that keyword though. You might want to try removing it and see what happens.

 

-Doug

0 Kudos
Message 6 of 10
(6,002 Views)

@YashT wrote:

... Can I just edit a single process model somewhere so that a report is generated for all of the sequences? ...

 


Hi YashT,

What you're talking about is something along the lines of the Sequence Editors "Run Selected Steps Using..." command, but I don't think this is available via the command line (or can be easily coded into a modified Process Model). At least I can't think of anything of the top of my head.

 

My suggestion would be that instead of modifying the process model sequence, that you break up the sequence file that contains the sequences you plan on running via command line into separate sequence files, and have the MainSequence of each these files call the single sequence in its own file. You can still reference all of the other sequences it might be calling by specifying the file name (instead of checking the 'Use Current File' option) in sequence calls. This way instead of changing the sequence name in your command line, you change the file name instead, and you don't need to make any changes to the process model.

 

Thinking about it a bit more, you could leave your original sequence file as is, and just create separate sequence files as described above, and then have a single sequence call in each of the MainSequences pointing back to the sequence in your existing sequence file that you want that file to run.

 

Hope this helps.

 

-Jack

0 Kudos
Message 7 of 10
(5,980 Views)

Hi Yash/Jack,

 

Can you help me how to read the Pass/fail Status of the Test Execution through Command Line or from QC.

 

I am actually trying to run a test sequence from QC through SIngle Pass Entry and trying the capture the Pass/Fail Status back into QC.

 

-VJ

0 Kudos
Message 8 of 10
(5,659 Views)

Hey VJ,

 

I'm unfamiliar with QC; what functions does it provide for running custom code or external applications? That will affect our options.

 

The cleanest way to accomplish this from an external application is to use the TestStand API to launch the sequence execution and then query for the status of that execution. However, this would either require us to access the TestStand ActiveX server from QC or write a short program in a language such as LabVIEW or C which performs these tasks. Perhaps we could then call that program from QC.

 

In any case, there will hopefully be a way to do this but it depends on QC. Any further detail you can provide about what options are available to you would be very helpful. Let us know!

0 Kudos
Message 9 of 10
(5,618 Views)

Hi Yash/Jack/VJ,

 

Is there any way to transfer Pass/Fail status of sequence execution that we get on console by using \OutputToStdIO command into a txt file ?

 

I tried the general way of storing any command result into text file that is > C:\Desktop\result.txt. the text file is updating every time but it is completely empty.

 

Could you please let me know if there is any way to do it ?

 

Thanks,

PV

0 Kudos
Message 10 of 10
(2,152 Views)