August 20, 2007

Running Executables from TestTrack Automation Rules

Helix ALM
You can add the run executable action to triggers and escalation rules to run a script or compiled program when a rule passes.
  • Triggers that run before records are saved can run server scripts that perform additional checks before saving.
  • Triggers and escalation rules that run after records are saved can run server scripts that perform additional actions based on the saved record. For example, you can create scripts to send record information to an external reporting system.
Keep the following in mind:
  • The executable must be located on the TestTrack Server computer because the server launches the executable.
  • The server administrator should make sure that appropriate directory access permissions are set up for the executable. The executable must have the same run privileges as the TestTrack Server.
  • The executable path specified in the run executable action must specify the relative or absolute path to a single file. Multiple files and arguments are not supported.
If TestTrack cannot find the executable, an error message is returned to TestTrack and the action configured in the trigger or escalation rule does not run. Executables that run before records are saved should return a value that tells the server if records can be saved. A return value of zero means that the records should be saved. A nonzero value means that the records should not be saved. If a non-zero value is returned, any messages output by the executable (output to stdout) are sent to TestTrack with the error message. Note that this error message is truncated to 1024 characters. Following are some examples of how to return a value from the triggered executable:
  • From a C program, specify the value in the return() statement in the main() routine. You can also use a parameter in the exit statement.
  • From a Windows/DOS batch file, set the ERRORLEVEL value. In Windows 2000/XP, batch scripts with the “exit/B#” command can be used.
  • From a Windows application, use the CWinApp::ExitInstance() function.