Buffer operations

The automation tools modules for buffer operations can create buffers, save values to them, and manage buffered arrays for later test steps to read.

TBox Set Buffer

Creates a buffer with a particular value or verifies the value of an existing buffer.

Value

Description

<Buffername>

Replace <Buffername> with the name of the Buffer.

To save a value to the buffer, enter the desired value into the Value column. Use action mode Input.

To verify the value of the buffer, enter the value in question into the Value column. Use action mode Verify.

Buffer a license plate number

In this example, you save a license plate number to a buffer:

  • <Buffername> has the name LicensePlate.

  • Value has ABC1234 and uses action mode Input.

Screenshot of the test step values that save a license plate number to a buffer.

Click to enlarge: Save a license plate number to a buffer

TBox Name To Buffer

Buffers the name of the test case that uses the module, so you can reuse it in other test cases.

Value

Description

Buffer

Name of the buffer to which you want to save the test case. Use action mode Input.

Save the test case name to a buffer

In this example, you save the test case name to a buffer:

  • Buffer has the value TestCaseName. This is the name of the new buffer.

  • Buffer uses action mode Input.

Screenshot of the test case First test case with the test step values that save the test case name to a buffer.

Click to enlarge: Save the test case name to a buffer

TBox Partial Buffer

Buffers parts of a value and verifies parts of a buffered value.

Value

Description

Buffer

Name of the buffer.

Value

Value you want to buffer or verify.

  • To buffer a value, use action mode Input.

    If you want to buffer a value of another buffer, enter the syntax that you use to read out buffered values in your test cases.

  • To verify a value, use action mode Verify.

Start

Character index from which you want the system to start buffering or verifying the value.

End

Character index that ends the value you want to buffer or verify.

Last

Number of characters you want to buffer or verify, starting from the last character.

If you set this value, Tosca Cloud ignores the values Start and End.

Buffer and verify the year of a date

In this example, TBox Partial Buffer saves the year of a date to a new buffer and verifies it:

  • The first test step uses TBox Set Buffer to create the buffer ManufactureDate with the value 06/19/2023.

  • The second test step uses TBox Partial Buffer to save the last four characters of ManufactureDate to the buffer ManufactureYear.

  • The third test step uses TBox Partial Buffer to verify that ManufactureYear has the value 2023.

Screenshot of three test steps that save and verify the year of a date.

Click to enlarge: Buffer and verify the year of a date

TBox Delete Buffer

Removes individual or all existing buffers.

Value

Description

Buffer

Name of the buffer you want to delete. Use action mode Select.

To delete all buffers, leave this value empty or enter the wildcard character *.

Delete the buffer TestCaseName

In this example, TBox Delete Buffer deletes the buffer TestCaseName:

  • Buffer has the value TestCaseName.

  • Buffer uses action mode Select.

Screenshot of the test step values that delete one buffer.

Click to enlarge: Delete the buffer TestCaseName

Delete all buffers of the test case

In this example, TBox Delete Buffer deletes all buffers:

  • Buffer is empty.

  • Buffer uses action mode Select.

Screenshot of the test step values that delete all buffers.

Click to enlarge: Delete all buffers of the test case

TBox Iterate Array

When Tosca Cloud buffers a row or column of a table, it organizes that information into an array. The module TBox Iterate Array iterates a buffered array, such as a table row or column. TBox Iterate Array outputs each array element individually. For instance, you can buffer a column containing customer names and send each name individually to the system under test. Tosca Cloud sends each array element in sequential order.

Value

Description

Array

Parent containing one array and one target. Add as many as you need for your use case.

Array To Iterate

Name of the buffer that contains an array you want to iterate.

Target Buffer

Name of the buffer that should receive the iterated output. Use action mode Input.

Use TBox Iterate Array to send each array element to your application with one test step.

To iterate a buffered array, follow these steps:

  1. Add a WHILE loop to your test case.

  2. Under Condition, add TBox Iterate Array and set its values.

  3. Under Loop, add the test steps that use the target buffer.

Enter each price in a loop

In this example, three test steps send each element of the buffered array Product Price as keyboard input:

  • The first test step uses TBox Array Operation to create the array with two elements.

  • The second test step uses TBox Iterate Array under Condition of the WHILE loop. Array To Iterate has the value {B[Product Price]}, and Target Buffer has the value Current price. Both use action mode Input.

  • The third test step uses TBox Send Keys under Loop of the WHILE loop. It sends keyboard input to an application window. Keys has the value {B[Current price]} and uses action mode Input.

Tosca Cloud runs the test steps and sends 19.99 in the first loop run and 99.99 in the second loop run.

Screenshot of a WHILE loop with TBox Iterate Array under Condition and TBox Send Keys under Loop.

Click to enlarge: Enter each price in a loop

TBox Array Operation

You can use this module to run advanced operations with array elements of an existing buffer. Or you can use it to create an array from elements you manually define.

Value

Description

Array

Use the dynamic expression {B} to define which buffered array you want to run your operation on. Use action mode Select.

Content

Your use case determines what you need to do with Content.

Item

Use Item to specify index positions with one of the following values:

  • # <index position number>. Index positions start at 1.

  • #last to specify the last element in the array.