> For the complete documentation index, see [llms.txt](https://sealights-docs.tricentis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sealights-docs.tricentis.com/setup-and-configuration/command-line-interface/search-test-repositories.md).

# Search Test Repositories

The `search_testrepo` commands manage the recurring scheduled scan that discovers test cases in your configured test repository adapters. This scan replaced the legacy `testrepo run` command from earlier versions.

`search_testrepo run` registers a Windows Scheduled Task that runs `watcher.exe SEARCH_TESTREPO` on a cron schedule.

## Schedule a search

### `slabapcli search_testrepo run`

Registers (or updates) a Windows Scheduled Task that runs the test repository search on a cron schedule. The task is registered per pipeline and test repository combination, in the `\SeaLights` folder of Windows Task Scheduler. Running the command again for the same pipeline and test repository replaces the existing task.

The command does not start a search immediately. The first search runs at the next time the cron schedule fires (in the machine's local time).

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Syntax" overflow="wrap" %}

```batch
slabapcli.exe search_testrepo run --pipeline <pipeline> --testrepo <name> [--cron <cron>]
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Syntax" overflow="wrap" %}

```powershell
.\slabapcli.exe search_testrepo run --pipeline <pipeline> --testrepo <name> [--cron <cron>]
```

{% endcode %}
{% endtab %}
{% endtabs %}

| Parameter    | Short flag | Required | Description                                                                                                                                                                                               |
| ------------ | ---------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--pipeline` | `-p`       | Yes      | The pipeline name (must match a `[[pipeline]].name` value in `config.toml`).                                                                                                                              |
| `--testrepo` | `-t`       | Yes      | The test repository name (must match a `[[testrepo]].name` linked to this pipeline).                                                                                                                      |
| `--cron`     | —          | No       | A 5-field cron expression (`minute hour day-of-month month day-of-week`), evaluated in the machine's local time. Only the forms listed below are supported. Default: `0 2 * * 0` (every Sunday at 02:00). |

#### Supported cron expressions

The agent supports a subset of Unix cron. The day-of-month and month fields must always be `*`. Any other expression is rejected and no task is registered.

| Form          | Meaning                                                                                                                 | Example                                              |
| ------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `M * * * *`   | Every hour at minute `M`                                                                                                | `30 * * * *` — every hour at :30                     |
| `*/N * * * *` | Every `N` minutes                                                                                                       | `*/15 * * * *` — every 15 minutes                    |
| `M/N * * * *` | Every `N` minutes, with the first run at minute `M`                                                                     | `5/15 * * * *` — every 15 minutes, starting at :05   |
| `M H * * *`   | Every day at hour `H`, minute `M`                                                                                       | `0 1 * * *` — every day at 01:00                     |
| `M H * * D`   | Once a week on day `D` at hour `H`, minute `M`. `D` is a single value: `0`-`7` (`0` and `7` are Sunday) or `SUN`-`SAT`. | `0 3 * * 1` or `0 3 * * MON` — every Monday at 03:00 |

Ranges (`1-5`), lists (`1,3`), and more than one day of the week are not supported. To search more than once a week, use the daily form (`M H * * *`).

#### Example

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Command" overflow="wrap" %}

```batch
slabapcli.exe search_testrepo run --pipeline "ALM_Demo-S21" --testrepo "ALM_Demo-qtest"
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe search_testrepo run --pipeline 'ALM_Demo-S21' --testrepo 'ALM_Demo-qtest'
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code title="Expected output (PowerShell)" overflow="wrap" lineNumbers="true" %}

```log
.\slabapcli.exe search_testrepo run --pipeline 'ALM_Demo-S21' --testrepo 'ALM_Demo-qtest'
[2026-03-08 11:00:00.123+02:00] [info] Config pathname: C:\ProgramData\Tricentis\SeaLights\ABAP Agent\config\config.toml
Search task scheduled for 'ALM_Demo-qtest' (pipeline: 'ALM_Demo-S21').
```

{% endcode %}

{% hint style="info" %}
The scheduled task resolves `watcher.exe` from the path configured in `settings.install`. Verify that `settings.install` points to the ABAP Agent `bin` directory (the folder that contains `watcher.exe` and `slabapcli.exe`). If the path is incorrect, the task will fail when it runs. Use `slabapcli setup status` to check.

If the ABAP Agent server is not reachable when you run the command, the task is still registered and the CLI prints a warning; the scheduled task cannot run until the server starts.
{% endhint %}

***

## Stop a scheduled search

### `slabapcli search_testrepo stop`

Removes the Windows Scheduled Task for the specified pipeline and test repository. The command disables the task, stops a run of it that is in progress (waiting up to 10 seconds for the run to end), and then deletes the task. If a search is still running after that wait, the CLI logs a warning. The command reports success even when no task was registered.

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Syntax" overflow="wrap" %}

```batch
slabapcli.exe search_testrepo stop --pipeline <pipeline> --testrepo <name>
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Syntax" overflow="wrap" %}

```powershell
.\slabapcli.exe search_testrepo stop --pipeline <pipeline> --testrepo <name>
```

{% endcode %}
{% endtab %}
{% endtabs %}

| Parameter    | Short flag | Required | Description               |
| ------------ | ---------- | -------- | ------------------------- |
| `--pipeline` | `-p`       | Yes      | The pipeline name.        |
| `--testrepo` | `-t`       | Yes      | The test repository name. |

#### Example

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Command" overflow="wrap" %}

```batch
slabapcli.exe search_testrepo stop --pipeline "ALM_Demo-S21" --testrepo "ALM_Demo-qtest"
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe search_testrepo stop --pipeline 'ALM_Demo-S21' --testrepo 'ALM_Demo-qtest'
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code title="Expected output (PowerShell)" overflow="wrap" lineNumbers="true" %}

```log
.\slabapcli.exe search_testrepo stop --pipeline 'ALM_Demo-S21' --testrepo 'ALM_Demo-qtest'
[2026-03-08 11:02:00.456+02:00] [info] Config pathname: C:\ProgramData\Tricentis\SeaLights\ABAP Agent\config\config.toml
Scheduled search task for 'ALM_Demo-qtest' (pipeline: 'ALM_Demo-S21') was removed.
```

{% endcode %}

***

## Check search status

### `slabapcli search_testrepo status`

Shows the current Windows Scheduled Task state and the result of the last search run for the specified pipeline and test repository.

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Syntax" overflow="wrap" %}

```batch
slabapcli.exe search_testrepo status --pipeline <pipeline> --testrepo <name>
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Syntax" overflow="wrap" %}

```powershell
.\slabapcli.exe search_testrepo status --pipeline <pipeline> --testrepo <name>
```

{% endcode %}
{% endtab %}
{% endtabs %}

| Parameter    | Short flag | Required | Description               |
| ------------ | ---------- | -------- | ------------------------- |
| `--pipeline` | `-p`       | Yes      | The pipeline name.        |
| `--testrepo` | `-t`       | Yes      | The test repository name. |

#### Example

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Command" overflow="wrap" %}

```batch
slabapcli.exe search_testrepo status --pipeline "ALM_Demo-S21" --testrepo "ALM_Demo-qtest"
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe search_testrepo status --pipeline 'ALM_Demo-S21' --testrepo 'ALM_Demo-qtest'
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code title="Expected output (PowerShell)" overflow="wrap" lineNumbers="true" %}

```log
.\slabapcli.exe search_testrepo status --pipeline 'ALM_Demo-S21' --testrepo 'ALM_Demo-qtest'
[2026-03-08 11:04:00.789+02:00] [info] Config pathname: C:\ProgramData\Tricentis\SeaLights\ABAP Agent\config\config.toml
Scheduler: task is registered and enabled, next run: 2026-03-15T02:00:00.
Last run: process 'proc-abc123' status: Done, upload status: Done
```

{% endcode %}

The status output reports:

* **Scheduler state** — whether the task is registered (`task is not registered` when it is not), enabled or disabled, and when the next run is scheduled.
* **Last run** — the process ID and process state (`Running`, `Done`, `Error`) of the most recent search. The upload state (`Pending`, `Done`, `Error`) is shown when the server reports one. If the last run failed, the output shows `Last run failed at <time>` followed by a `Reason:` line. If the server also returns a message about the run, it is printed as `Server message:`. If no run has been recorded, `no prior run recorded` is shown.
