TextStream modules

The technology-specific modules for TextStream can open, modify, save and close a TextStream.

TextStream Open/Load

Opens a TextStream. A TextStream is an object which represents a stream of text from a text source in a file system. Additionally, you can load content from an external source into the TextStream that you specify.

Value

Description

Stream Name

The name of the TextStream you want to open or load content into.

Load Source Type

Optionally, you can load content from an external source into the specified TextStream. To do so, choose one of the following sources as a value:

  • Clipboard: loads content from the system clipboard.

  • File: loads content from a file you specify.

  • Buffer: loads content from a buffer you specify.

Load Source Identifier

If you specified the value File or Buffer for Load Source Type, use this to specify the complete path to the file or the buffer name.

Load Operation Type

Type of operation you want to perform when you load content into the TextStream. You can specify the following operation types:

  • Replace: replaces the current TextStream content with the content from the specified source. This is the default value.

  • Append: appends the content from the specified source to the end of the current TextStream, without creating a new line.

  • Append to New Line: creates a new line in the current TextStream and appends the content from the specified source to it.

Line Separator

Line separator setting for the TextStream. You can specify the following line separators, which depend on the Operating System (OS) under test:

  • Windows (default value)

  • Unix

  • Legacy Mac OS

Encoding

Specify the character encoding to use when you load a file.

If you don't specify any value, Tosca Cloud uses UTF-8 as the default encoding.

TextStream Save/Close

Closes a TextStream and optionally, saves its content to an external destination.

Value

Description

Stream Name

The name of the TextStream you want to close or save.

Destination Type

Destination where you want to save your TextStream. You can specify the following destinations:

  • Clipboard: saves the content to the system clipboard. This is the default value.

  • File: saves the content to a file you specify.

  • Buffer: saves the content to a buffer you specify.

  • None: doesn't save the content.

Destination Identifier

If you specified the value File or Buffer for Load Source Type, use this to specify the complete path to the file or the buffer name.

Encoding

Choose a text encoding option from the dropdown menu. The default value is UTF-8.

Keep Stream Open

Tosca Cloud closes the TextStream by default. If you want to leave it open after saving, set this value to True.

TextStream Block Text Manipulation

Manipulates the content of a TextStream as a single block of text.

Value

Description

Stream Name

The name of the TextStream you want to manipulate.

Target Line

Specifies which line of text to load from the TextStream. You can specify one of the following values:

  • An integer <n>: loads the specified line. For example, the value 2 loads the second line of the text.

  • One or more strings separated by a semicolon (;) <string1>;<string2>;<...>: loads the first line which contains all the strings you specify.

If you don't specify a Target Line value, Tosca Cloud uses one of the following defaults based on the Input Operation Type:

  • 1 for Replace and Append.

  • #last for Append to New Line.

Input Operation Type

If you use action mode Verify for Content, leave the value empty.

If you use action mode Input for Content, choose an operation to perform when you insert the specified content into the TextStream.

You can specify the following operation types:

  • Replace: replaces the current TextStream content with the specified content.

  • Append: appends the specified content to the end of the specified Target Line. This is the default value.

  • Append to New Line: creates a new line in the current TextStream and appends the specified content to it.

Field Separator

Optionally, specify the character that separates your values in your Target Line. For instance, a semicolon (;) is the separator of the following example: <Name>;<Age>;<Country>.

Line Length

Optionally, specify the maximum number or characters of the Target Line.

Total Field Count

Optionally, specify the number of fields in your TextStream, based on Field Separator.

Content

Text content you want to steer. Note the following when you specify the content of your TextStream:

  • You can have multiple Content values in the same module. To do so, copy and paste this value into the Module as many times as required.

  • By default, this value is a TextBox. To use it as a ListBox, you can change the default parameter BusinessType to ListBox. This is particularly helpful if you want to steer multiple text fields as a list.

Optionally, you can add the following configuration parameters:

  • AlignToRight: set this configuration parameter to True to align characters to the right. By default, Tricentis Tosca aligns text fields to the left.

  • Length: specifies the maximum number of characters.

  • Offset: specifies the number of characters to offset starting from the first character of the Target Line.

  • Position: specifies the position of this Content (as an integer) in relation to the other fields, if you use a Field Separator. For instance, if you specify the value 2, Tosca Cloud locates the specified Content in the second available field of the specified Target Line.

TextStream Table Text Manipulation

Manipulates the content of a TextStream which is formatted as a table.

Value

Description

Stream Name

Name of the TextStream you want to manipulate.

Start Line

Optionally, specify the line number of the first line of text that you want to load from the TextStream.

End Line

Optionally, specify the line number of the last line of text that you want to load from the TextStream.

Input Operation Type

If you use action mode Verify for Content, leave the value empty.

If you use action mode Input for Content, choose an operation to perform when you insert the specified content into the TextStream.

You can specify the following operation types:

  • Replace: replaces the current TextStream content with the content you specify. This is the default value.

  • Append: appends the specified content to the end of the current TextStream. If you specified a Start Line or an End Line, it appends the specified content to the end of the last available line.

Column Definition Value

Value that specifies the columns of the tabulated text content. You can specify the following column separators:

  • <SPACE> and <TAB>: special column separator values which represent their white space equivalents. The default value is <SPACE>.

    An integer greater than 0: specifies a fixed column width of that number of characters for every column.

    You can optionally specify an offset in square brackets ([<offset>]). The reference for the offset is the first character of the loaded line content.

    For example: 15 or 15[21]

  • A set of integers greater than 0, separated by a semicolon (;): individually specifies the column width for each column.

    You can optionally specify an offset in square brackets ([<offset>]). The reference for the offset is the first character of the loaded line content.

    For example: 3;15;15;10 or 3[13];15[21];15[44];10[59]

  • Any character or character sequence other than an integer greater than 0 specifies a variable column width. For example, if you specify a character such as #, Tosca Cloudinterprets each of those as a column.

Content

The table content that you want to steer.