Work with Instances

TestCase-Design Instances are possible variants of Attributes. In the example below, the Attribute Fuel Type has several possible variants, which are shown as Instances:

Fuel Type Instances

Create an Instance

You can create an Instance for a TestSheet, a TestCase-Design Attribute or a TestCase-Design Class. You can create Instances in different ways according to your requirements and preferences:

  • manually

  • by assigning values

  • from ModuleAttributes

Create an Instance manually

To create an Instance manually, follow the steps below:

  1. Right-click on the object you want to create an Instance for.

  2. Select Create Instance from the mini toolbar.

    Alternatively, press Ctrl N + Ctrl I to create a new Instance.

    Instances are contained within Instances Collections, so if a newly created Instance is the first Instance within an Attribute, Tricentis Tosca automatically creates an Instances Collection.

Instances Collection

  1. Rename the Instance as desired. TestCase-Design Instances must have unique names.

Create an Instance by assigning values

You can create an Instance by adding a value to an Attribute. To do so, follow the steps below:

  1. Select an Attribute that is used in a TestSheet or a TestCase-Design class.

  2. In the Details view of the selected Attribute, enter a value of your choice.

Tricentis Tosca will create a new Instance with the entered value.

Create an Instance by adding a value

Create an Instance from ModuleAttributes

You can create Instances by dragging and dropping a ModuleAttribute or an XModuleAttribute onto a TestCase-Design Attribute. Tricentis Tosca automatically creates an Instance within the selected TestCase-Design Attribute.

If you drag and drop a ModuleAttribute from a classic Module onto a TestCase-Design Attribute, you are prompted to select one of the following options:

  • Create StructureElement from Moduleattribute: Tosca creates an Attribute structure element for the ModuleAttribute.

Instances with structure element _NewModuleAttribute

  • Complete Instances from ValueRange: Tosca creates Instances from the ValueRange of the Module Attribute. You can add the ValueRange column to the Details view of your ModuleAttribute using the column chooser.

Instances from ValueRange

Define Instance Character

You can define different properties for each Instance that specify when and how a particular Instance is used.

You can specify the Instance type by using the Character property. The available Character options are:

  • Valid: The Instance is valid for the business process, so you do not expect an error to occur. This is the default value.

  • Invalid: The Instance is invalid for the business process, so you expect an error to occur. This allows you to check whether a value outside of your business parameters in fact returns an error as expected.

  • Straight Through: specifies the path through the application with the least dependencies. It is also the path that has the highest risk if it were to fail because it is the most frequently used. A Straight Through path is required for linear expansion.

You can change an Instance Character by using the Toggle Character button in the dynamic menu TestCase Design.

Character toggle button

Alternatively, you can change the Character value of an Instance in the Properties pane.

Instance Character in Properties pane

Define Instance Position

You can define the position of an Instance as an inner value or a boundary value in order to build suitable TetsCases. If a value falls around the boundary of a particular test range, it may require extra testing.

To indicate that a particular value is a boundary value, use the Toggle Position button in the dynamic menu TestCase Design to change the Position property from Inner to Boundary.

For example, your system under test requires users to enter their age. The available value range is 1 to 99. In this case, you may want to establish the values 1 and 99 as boundary values.

This allows you to test whether the system returns an error for values <1 or >99, but accepts 1 and 99 as valid inputs.

Toggle Position button

A boundary value is denoted by the icon if it is a valid Instance, and by the icon if it is an invalid Instance.

If you set the Instance Character to Straight Through, the position is automatically set to Inner and cannot be changed.

Alternatively, you can change the Position value of an Instance in the Properties pane.

Instance Position in Properties pane

Merge duplicate Instances

You can merge duplicate Instances with identical values, including identical Character and Position properties. To do so, follow the steps below:

  1. Right-click the Class that contains Instance duplicates.

  2. Select Merge Instance Duplicates from the context menu.

Merge duplicates via the context menu

Tricentis Tosca automatically merges any duplicated Instances.

Alternatively, you can manually merge Instances by dragging and dropping an Instance onto another Instance you want to merge it with.

Create EMPTY and NULL Instances

If you want to create EMPTY or NULL Instances, you must enable these options under Project->Options->TestCaseDesign.

Enable EMPTY-Instances and NULL-Instances in Options dialog

A NULL-Instancecreates an Instance with the value zero. You can only create one NULL-Instance per structural element.

An EMPTY-Instance creates an Instance with an empty string. Tricentis Tosca considers this empty string when combining Instances and when instantiating TestCase Templates. You can only create one EMPTY-Instance per structural element.

Create an EMPTY-Instance

To create an EMPTY-Instance, right-click on a TestSheet, Instances Collection, or Attribute and select Create EMPTY-Instance from the mini toolbar.

Create EMPTY-Instance

Create a NULL-Intance

To create a NULL-Instance, right-click on a TestSheet, Instances Collection, or Attribute and select Create NULL-Instance from the mini toolbar.

Create NULL-Instance