Add assertions

Add assertions to verify that the job is executing as expected.

You can add assertions at any point to check for the pending activities, a variable value, process state, activity assignment and event. You can also check for the details of the pending activities within an embedded process or subjob.

Assertions are based on the current point of the process using variable values, states, and more. If you add an assertion at the point when execution is within a sub job, the data from the subjob is used.

You can add multiple assertions of same or different types. For example, activity status and variable assertions can be used in the same test script but not in the same assertion.

You can modify an assertion when the execution has stopped at a point. You can delete an assertion.

To add an assertion, in the test case viewer page, on the Execution path tab, click Add assertion. The Add assertion dialog box is displayed. You can add the following assertion types: Activity, Event, State and Variable value.

Add an activity assertion

Add an assertion on an activity status (only pending) and activity assignment in the parent job or active sub job or embedded process.

  1. In the Add assertion dialog box, on the Assertion type list, select Activity.
  2. Click Add activity.

    The Select activity dialog box is displayed.

  3. On the Activity name list, select the activity, for example, Activity1.

    You can select an activity from the currently pending activities from parent job or active subjob. You cannot select the case job activities.

  4. Optional. To assert on the activity assignment, select Test resource assignment. The current assigned resources are listed which is non-editable.
  5. Click OK.

    Under Steps/Assertions, the added assertion Execute: Activity1 changes as Assert: Activity1 Pending.

  6. Click Save.

    On execution, the assertion fails if the activity is not pending or is not assigned to the correct resources depending on the configuration.

Add an event assertion

You can assert on event's count within the parent job or active subjob or case or embedded process.

  1. In the Add assertion dialog box, on the Assertion type list, select Event.
  2. Click Add event.

    The Select an event dialog box is displayed.

  3. Click Add event.

    The Select an event dialog box displays the events associated with a process and case under Process and Case tabs.

  4. Select the event from the parent job or active sub job and click OK.

    The current event name and the event count are displayed.

    Under Steps/Assertions, the added assertion is displayed as Assert: Event Name. Count = "current event count".

  5. Click Save.

    On execution, the assertion fails if the event count does not match with the configured value.

Add a process state assertion

You can assert on the current process state's value within the parent job or active sub job or case or embedded process (which is part of parent job).

  1. In the Add assertion dialog box, on the Assertion type list, select State.

    The process state from the parent job or active subjob or case is displayed. The current job state is displayed which is non-editable.

  2. Click Save.

    Under Steps/Assertions, the process state assertion is displayed. On execution of test case, the assertion fails if the job is not in the correct state.

Add a variable value assertion

You can assert on variable value in the parent job, embedded processes (which are part of parent job), active subjobs, case variables and server variables.

You cannot add assertions on the following variable types: Complex, Dynamic complex, Checklist, and Data backbone.
  1. In the Add assertion dialog box, on the Assertion type list, select Variable value.
  2. Click Add variable.

    The Select a variable dialog box displays the process and server variables under Process and Server tabs.

  3. Select the variable and click OK.

    The selected name and variable are displayed.

  4. Click Save.

    The variable name and its value are displayed. On execution, the assertion fails if the variable value is not correct.