Skip to content

Invoke Another Case: INVOKETEST

The Invoke Another Case action allows you to call another case within the current case, enabling modular and reusable automation. This is especially useful when you want to run shared logic (such as login steps or validations) across multiple test cases.

Steps to Configure:

  1. Add a new step to your case.
  2. From the Action drop-down, select Invoke Another Case.
  3. Leave the Screen Name field blank.
  4. In the Element Key field:
    • Leave it blank if you want the automation to continue even if the invoked case fails.
    • Enter break (in lowercase) if you want the automation to stop immediately when any step in the invoked case fails.
  5. Use the Search By Name field to find the test case you want to invoke.
  6. Select the desired case from the search results.
scrn-invoke-test-tabular-view
Tabular View
scrn-invoke-test-card-view
Card View
  1. (Optional) Set the iteration count if the invoked case should run multiple times.
  2. Click Save.

Note: While the configuration steps are identical in both Tabular View and Card View, the layout of the steps may look different.

Expected Outcome on Execution:

  • If no value is entered in the Element Key field:
    • The invoked case will execute.
    • Even if any step fails inside the invoked case, the automation will continue with the next steps in the main case.
  • If break is entered in the Element Key field:
    • The invoked case will execute.
    • If any step inside the invoked case fails, the automation will stop immediately, and subsequent steps in the parent case will not be executed.
    • The failure message will be shown on the HuLoop Agent and reflected in the Web Report.

Example 1: Reusing a Verify Login Case

Suppose you have a test case named “Verify Login” that performs the login operation. You want to reuse it in a larger end-to-end flow instead of duplicating login steps each time.

Steps to Configure:

  1. Add a step and choose Invoke Another Case from the Action drop-down.
  2. Leave Screen Name and Element Key fields blank.
  3. In the Element Key field, enter break (case-sensitive).
  4. Search and select the case named Login Test.
  5. Click Save.
scrn-invoke-test-reusing-case-tabular-view
Tabular View
scrn-invoke-test-reusing-case-card-view
Card View

Expected Outcome on Execution:

  • The selected case (e.g., Verify Login) is executed at this step in your current test flow.
  • After successful execution, the automation continues with the next steps in your main case.

Example 2: Halting Automation When Login Verification Fails

You have a case named “Verify Login” that checks if the login credentials are valid before proceeding with other actions like accessing user data or navigating to secure pages. If the login check fails, you want to stop the test immediately to avoid unnecessary steps or incorrect test outcomes.

Steps to Configure:

  1. Add a step and select Invoke Another Case from the Action drop-down
  2. Leave the Screen Name field blank
  3. In the Element Key field, enter break (case-sensitive)
  4. Search and select the case named Verify Login
  5. Click Save.
scrn-invoke-test-halt-automation-tabular-view
Tabular View
scrn-invoke-test-halt-automation-card-view
Card View

Expected Outcome on Execution:

  • If Verify Login passes, the automation continues with the next steps.
  • If any step in Verify Login fails, the automation halts.
  • The failure and termination are visible in the HuLoop Agent logs and Web Report, indicating that all subsequent steps were skipped due to the failure.
    • The screenshot below shows the case failure message as displayed in the HuLoop Agent.
scrn-invoke-test-execution-stopped
Execution Stopped in HuLoop Agent
    • The following Web Report highlights how the invoked case failure is captured in test results, with skipped steps after the failed action.
scrn-invoke-test-execution-failure-web-report
Execution failure in Web Report

Back To Top