Command
Use the Command step to run a command line program. The command step has one associated action: Exec.
Description
Runs a command line program.
Parameters
Parameter |
Description |
---|---|
name=commandname |
The command name as defined on the Define Configuration Options page. |
timeout=seconds |
The number of seconds before the program times out. |
ret=&variable |
The variable to store the return value. |
Example
This is an example of a command line program that requires multiple parameters.
Type |
Action |
Recognition |
Parameters |
Value |
---|---|---|---|---|
Command |
Exec |
name=TEXT_COMP |
timeout=60;ret=&return |
WORDVP c:\temp\base.txt c:\temp\actual.txt c:\temp\comparison.doc |
If the command line program is used in multiple tests, you should create a library test for the command. This example shows a test library created for the FILEKILL command. The command has one parameter FILENAME.
Note: FILEKILL and FILECHECK commands are examples of possible utilities to call from PTF, they are not delivered with PTF. Customers are responsible for creating their own command line programs.
This example illustrates the FILEKILL command.exec step, it has one parameter FILENAME. This command will look for a specific file and delete it if it exists. If the file cannot be deleted it returns a 1.

This is an example of the calling test, which illustrates how the command can be called from a test. This test will delete the file before running a process to create a new file.
Type |
Action |
Recognition |
Parameters |
Value |
---|---|---|---|---|
Browser |
Start_Login |
|
|
|
Variable |
Set_Value |
&filename |
|
c:\Labs\files\menu.pdf |
Test |
Exec |
FILEKILL_LIB;FILENAME=&filename |
|
DEFAULT |
Browser |
FrameSet |
TargetContent |
|
|
Page |
Prompt |
PROCESS_SCHEDULER.PRCSMULTI.GBL |
|
add update |
Text |
Set_Value |
Name=PRCSRUNCNTL_RUN_CNTL_ID |
|
test |
Page |
PromptOk |
|
|
|
Process |
Run |
prcname=XRFWIN |
prctype=BI Publisher;outtype=File;outformat=PDF;outfile=&filename |
|
Text |
Exec |
FILECHECK_LIB;FILENAME=&filename |
|
DEFAULT |