WriteCSV Command Step in Step Configuration WIzard

Since the use of this command is deprecated and will no longer be supported in future releases of the software, you are advised to use the WriteBlock command of the CSVAnalyzer session instead.

A WriteCSV command writes one or more TestComposer variables to an attached output file using a CSV format.

To add a WriteCSV command step using the GUI scripting support:

  1. While in the Test Steps pane, add a step by choosing the Actions > Add step... command.
  2. Select a WriteCSV step type, click the button to validate the selection, and specify the following parameters:
    • Run Type: A WriteCSV step can only be executed sequentially (Sequential).
    • Delay: A delay specifying by how much step start is delayed. A delay value is automatically set when the step is added using the Capture functionality.
    • Timeout: A period of time after which the step execution is considered to have timed out.
    • Ignore step: When this option is selected, the step is skipped at execution time. Selecting this option is equivalent to right-clicking a step in the Test Steps table and choosing the Exclude command from the context menu that appears.
    • Description: An optional step description can be associated with a step.
    • Click Next.

  3. Define the Conditional Execution settings as explained below.
  4. Conditional Execution settings enable you to define the system conditions a script step execution is monitored for. When such a predefined condition occurs – a step error or a step timeout – an user-defined procedure is executed and an additional action is performed. For example, on encountering a step error, you could enforce the execution of a cleanup procedure and then terminate the script.

    To monitor the step for a predefined Timeout or Error condition, select the corresponding condition, then define the associated procedure – local or shared (external) – by clicking the control of the Procedure field and selecting a procedure from the the drop-down pane that appears.

    For the selected procedure you can view its defined arguments by clicking the control of the Input Arguments field, which displays a cascading table-format pane containing the argument list. To specify the actual runtime argument(s) enter the desired values in the Current Value field(s).

    Configure an additional action by clicking into additional actions column and selecting either of the following options:

    • Continue: After performing the specified procedure, the script execution continues.
    • Exit Test: After performing the specified procedure, the script execution is terminated.
    • Click Next.

    Whenever the step execution is monitored for predefined events, an icon is displayed in the step's corresponding Events selected column entry. For information on turning on the displaying of the Events selected column refer to Customizing the Script Steps Table Layout.

  5. Specify the following parameters:
    • File Name: The output file, using either an absolute or a relative path, is specified by editing its name in place.
    • Alternatively to specifying a file name, you can specify a variable associated with an attached output file by clicking the button and selecting a variable from the window that appears.

    • Variable List: The space-separated variables whose values are written to the output file.
    • Custom headers: If selected, this option enables you to use custom column headers for the CSV table. By default, these headers are named after the variables that are contained in the table columns.

    The variables to be written into the file are treated as list-type variables, as illustrated by the examples below.

  6. Verify the step summary information and revert to a previous configuration step if needed. Click Finish.

  Examples:

Assuming we had a composite variable named volume containing 2 numeric variables target_1 and target_2, then a WriteCsv($file1;$volume) would generate an output such as the following:


Assuming we had the following variable assignation command:

    Assign var1 "1 {2 3 4} 5"

then a WriteCSV($file1; $var1) command would yield a result such as the following:

    var1
   1
   2 3 4
   5

If you want to write a variable with spaces on a single line of the output file, then you have to enclose that variable into {} characters, such as for example in {1 2 "the fox jumped over" 3 fences}.

  Opposed to all other TestComposer commands, including the WriteBlock command of the CSV Analyzer session, the WriteCSV command can access File Catalog variables regardless of their script location - i.e. in the script main procedure or in procedure bodies.
  This is a different behavior than that of the WriteBlock command, which is capable of accessing such variables only when the command is part of the script main procedure.