> For the complete documentation index, see [llms.txt](https://docs.walnutai.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.walnutai.ai/core-features/intelligence-hub/generate-test-cases/smart-recording/ai-recording/insert-test-cases-and-custom-methods.md).

# Insert Test Cases and Custom Methods

Smart Recording allows you to **reuse existing test cases and custom methods** within the current recording session. Instead of recreating workflows or actions that are already available, you can insert them directly into your recording at the required point.

This helps you **reuse existing automation, reduce duplicate steps, maintain consistency across test cases, and build complex test flows more efficiently**.

* Start a **Smart Recording** session.
* Click the **+** icon in the bottom bar. The **Insert test case** window opens with two tabs:
  * **Test cases:** Displays the test cases available in the current project.
  * **Custom methods:** Displays the custom methods available in the current project.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FVReP9HZapDEUIPOgOG5M%2FScreenshot%202026-09-25%20at%205.35.46%E2%80%AFPM.png?alt=media&amp;token=c5c9aa67-7b40-434d-8d6b-f9b65e44f80f" alt=""><figcaption></figcaption></figure>

* Select the required tab, choose the **test case or custom method** you want to reuse, and select the required **Environment** in which it should be executed.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2F8SY1ZYMAbGW47YkNyOUe%2FScreenshot%202026-09-25%20at%205.38.07%E2%80%AFPM.png?alt=media&amp;token=42efe2b3-e5de-4bc1-baa6-ea3a5aaedd7a" alt=""><figcaption></figcaption></figure>

* Select where you want to insert the **test case or custom method** in the current recording session:

  * **End of recording:** Adds the test case or custom method at the end of the recording.
  * **Start (after the opening Navigate):** Adds it after the opening Navigate step.
  * **Before the opening Navigate (first step):** Adds it before the opening Navigate step.
  * If the recording already contains steps, the available insertion points are displayed based on the existing steps. Select the required location.

  <figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FcUVys37AVo85sfnmy1nu%2FScreenshot%202026-09-25%20at%205.47.07%E2%80%AFPM.png?alt=media&amp;token=1c43c904-c4f4-41de-a2d2-d0e721cd999a" alt=""><figcaption></figcaption></figure>

* Enable **Run it now using its own test data, so recording continues from where it leaves the app** if you want the selected test case to execute immediately after insertion.&#x20;

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2F3Tzhq0qHTyORI7TieyEf%2FScreenshot%202026-09-25%20at%205.41.10%E2%80%AFPM.png?alt=media&amp;token=08417f78-979d-4f56-b08f-8a38f157b12f" alt=""><figcaption></figcaption></figure>

* If the option is not enabled, the selected **test case or custom method** is added to the recording without being executed immediately. You can then choose how to proceed from the chat panel:

  * **Run it now:** Executes the reused test case in the current browser session.
  * **Leave it as a block:** Adds the test case to the recording without executing it.
  * **Run everything from the start:** Clears the current session and replays the entire recording from the beginning, including recorded steps and inserted blocks.

  <figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2F9a57VzGaqXFAOyNlQfQg%2FScreenshot%202026-09-25%20at%205.44.21%E2%80%AFPM.png?alt=media&amp;token=c94003e3-86cf-4eed-9152-04dad2a1d2c0" alt=""><figcaption></figcaption></figure>

* The selected **test case or custom method** is added to the recording at the specified location, allowing you to reuse existing automation as part of the current test flow.
