The Write File tool can convert output data to files. You can add the Write File tool to API testing and service virtualization components the output data, such as test assets, message responders, and other tools. This tool is also available in the desktop tools. See Write File for additional information.

  1. Select a node for which you want to write output data.
  2. Choose Add Write File Tool from the actions drop-down menu.
     
  3. Configure the tool settings:
    1. Target name: Specify a name for the target file or use wildcards. Acceptable wildcards include:

      %bBase name of the original file (no extension).
      %fOriginal file name (with extension).
      %eExtension of original file name.
      %uUnique time-based ID.
      %dCurrent date.
      %t:Current time.
      %nTest name.
      %iRow index.
    2. Target directory: Specify where the tool saves the file it creates. Click in the filed and the auto-complete function will show available locations.
       
    3. You can also enable the following options for the target directory:

      Create directories

      Enable to allow the tool to create directories in the target directory.

       
      Override directory from inputEnable to allow the tool to always save files in the location specified in the Target directory field. If this option is not enabled, the tool will try to save the file in the source file’s directory; if the tool cannot write to that directory, it will save the file in the location specified in the Target directory field. 
      Backup file before overwritingEnable to allow the tool to backup files that are created before a modified file from a subsequent run is saved over the previous version. 
      Use UTF-8 encodingEnable to configure UTF-8 encoding for the file. 
      AppendEnable to append new content to the existing file instead of overwriting it. 
      Beautify XML outputEnable to properly format XML that is collected and written to the file. 
  4. If the extension tool is not attached to the output of another tool, you can specify an input for your script. Choose a MIME type from the drop-down menu and specify the text you want the tool to operate on.
     

 

  • No labels