To create or edit a ProcessExecutor test:
During execution of the executable the following two environment variables can be used:
- Environment Variable
- Description
- SCTM_EXEC_RESULTSFOLDER
- All files in this folder are saved as result files in
Silk Central. If an
output.xml file is created during execution in this directory, it is processed by
Silk Central.
- SCTM_EXEC_SOURCESFOLDER
- This is the folder where all source files used during the execution are located.
Note: To define these environment variables as arguments for a test, use the predefined parameters that are available for all test
types, instead of using the specific environment variable that is only available for ProcessExecutor tests. For example, use
#sctm_test_results_dir instead of
SCTM_EXEC_RESULTSFOLDER.
Examples
To configure a ProcessExecutor test that runs the Windows Script Host from the command line with the
/c switch and two parameters, specify the following:
-
/c - A command that specifies that the command line should terminate after execution.
- cscript - The Windows Script Host.
- parareadwrite.js - The jscript file.
To run the test on a Linux server, you can use the following Python script:
#!/usr/bin/env python
#
import sys
import os
print 'command and arguments: ' + str(sys.argv)
print 'SCTM_EXEC_RESULTSFOLDER: ' + str(os.environ.get('SCTM_EXEC_RESULTSFOLDER'))
Instead of using the environment variable
SCTM_EXEC_RESULTSFOLDER, you can set the predefined parameter
#sctm_test_results_dir as an argument in
Silk Central. The argument will be replaced with the corresponding environment variable when the script is executed.