Part 3: Communication between calling and called package

../../_images/Tut_PT_Part3.png

Objective

Communication by means of inboxes and outboxes between the calling and the called package.

Test creation

  1. Switch to “sender” in test case editor

  2. Create the variable “sendLine” with the type “outbox”, mark as return value

  3. Insert the test step “write to outbox” under Test steps ‣ Data operations (see image “Select test steps for inboxes and outboxes”) inside the loop, selecting “sendLine” as outbox and indicating “loopCounter” as message

  4. Switch to “main” in test case editor

  5. Create the variable “receiveLine” with the type “inbox”, maintaining the standard settings

  6. Create the numeric variable “receivedData” with the standard value

  7. Create the numeric variable “loopCounter” with the standard value

  8. After calling “receiver2”, insert a loop with the number “sendCountInput” and save the counter in “loopCounter”

  9. Call the package parameterization dialog for “sender” and activate the tab In-/Outboxes, create here a link between “sendLine” and “receiveLine” like in image “Link inboxes and outboxes via the package parameterization dialog”

  10. Insert the test step “read from inbox” under Test steps ‣ Data operations inside the loop, selecting the inbox “receiveLine”, saving the value in variable “receivedData” and specifying as expectation value that the measurement value is equal to “loopCounter”

  11. Save all packages and execute the main package

../../_images/ParalleleTests_Boxen.png

Select test steps for inboxes and outboxes

../../_images/ParalleleTests_BoxParameter.png

Link inboxes and outboxes via the package parameterization dialog

Result

The package “sender” transmits at every loop run its counter via an outbox to the calling package. The calling package reads out the counter with the linked inbox and compares it with its own counter.

Remark

Inboxes and outboxes are storages that can be linked between each other and serve for communication between packages. Every outbox is connected with an inbox. In our example the inbox and the outbox work according to the FIFO principle. For the purpose of communication between packages by means of in and out boxes, it is imperative for the box variable to be marked as input parameter or return value.