Skip to main content

Add assertion to test steps

Custom script verification allows you to add advanced validation logic to a specific step within a journey map. This is useful when built-in assertions are not sufficient, for example, when you need to validate dynamic UI text, computed values, or reuse shared assertion logic across multiple flows.

What this applies to
  • At this time, journey maps support verification only through Invoke custom script (Groovy). Element-based verifications (Add assertion option) will be introduced in a future release.
  • This feature is applicable for newly generated maps.

This guide explains how to add a custom script verification to a specific step within a journey map, with an interactive video for you to test it out.

Invoke custom script​

  1. In Katalon TestOps, go to Tests > Journey Maps.
  2. From the Journey Maps dashboard, click on the desired journey map to open it.
  3. Click View test steps to open the selected flow in Session Replay view.
  4. Locate the specific step you want to add verification to and click the Add (+) icon next to it.
  5. Select Invoke custom script (Groovy).
  6. Enter a Name for your script, for example, verifyCartItem.
  7. In the Imports and Custom Script fields, enter the script logic, for example:
import truetest.Toolshop.custom.CartAssertions as CartAssertions
--
CartAssertions.verifyCartItemCountFromText(findTestObject('AI-Generated/Toolshop/Page_checkout/label_cartItemCount'), 1)
  1. (Optional) Select Apply to similar flows in the current map to apply the custom script to other matching flows that do not already have test cases within the same journey map.
  2. Click the Save Changes button to save the custom script verification.

    The custom script verification is successfully added to the selected step in the journey map.

Carry over existing assertions​

When generating a new journey map, you can also carry over assertions added in previous maps.

The option is enabled by default. When selected, TrueTest reuses applicable assertions from previously generated maps to save time and maintain consistency. Assertions are carried over only when:

  • They are marked Apply to similar flows in the current map
  • The matching flow does not already have a test case
Was this page helpful?