> 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/sealights-agents-and-plugins/abap-agent/guides/customer-onboarding-for-automation.md).

# Customer Onboarding for Automation

This guide walks you through setting up SeaLights for continuous test optimization in a production SAP landscape using Tosca automation tests. By the end of this guide the agent will be fully configured to automatically detect code changes and optimize test execution.

## Prerequisites

Before you begin, make sure the following are in place:

{% stepper %}
{% step %}

### Set up the agent

Initialize the ABAP agent on the machine where it is installed. This generates the encryption key and default configuration file.
{% endstep %}

{% step %}

### Connect to SeaLights

Store your SeaLights agent token in the encrypted configuration so the agent can communicate with the SeaLights platform.
{% endstep %}

{% step %}

### Create RFC Destinations

Create an RFC Destination for each SAP system (QAS and PRD) that the agent needs to connect to.

{% hint style="info" %}
Repeat this command for every SAP system the pipeline will use (for example, once for QAS and once for PRD).
{% endhint %}
{% endstep %}

{% step %}

### Create a pipeline

Link your QAS and Production systems to a SeaLights application by creating a pipeline.
{% endstep %}

{% step %}

### Run the Initial Build Map

Create an Initial Build Map for the pipeline. This scans the QAS system for all ABAP code components that are in use in Production and sends them to SeaLights.

{% hint style="info" %}
The build map task runs two minutes after you issue this command. Wait for it to complete before proceeding.
{% endhint %}
{% endstep %}

{% step %}

### Start collecting Footprints

Enable the agent to collect Footprints data. When a test runs, the agent matches the ABAP components that were executed against objects in the latest build and sends this data to SeaLights.
{% endstep %}

{% step %}

### Observe the build in the SeaLights dashboard

Open the SeaLights dashboard and verify that your application appears with the initial build.

You should see:

* Your application listed with a build named after the pipeline.
* The build status shows as **completed**.

<figure><img src="/files/zAlkVA9inX9sVw7Ov2tL" alt="SeaLights dashboard showing the application with the initial build." width="563"><figcaption><p>The application appears in the SeaLights dashboard after the Initial Build Map completes.</p></figcaption></figure>
{% endstep %}

{% step %}

### Run the full test suite in Tosca

Run your **full suite** of automation tests in Tosca. Make sure the Tosca playlist is configured with the correct **SeaLightsLabId** so the test execution is associated with your pipeline.

See [Run a Test in Tosca](/sealights-agents-and-plugins/abap-agent/test-tool-integrations/tosca/run-a-test-in-tosca.md) for detailed configuration instructions.

<figure><img src="/files/aEKgipAnb3SMCniHGsly" alt="Tosca Cloud playlist configuration showing SeaLightsLabId parameter." width="375"><figcaption><p>Set <strong>SeaLightsLabId</strong> to the lab ID configured in the <code>pipeline set</code> command.</p></figcaption></figure>

{% hint style="warning" %}
Make sure you set the `SeaLightsLabId` parameter in the Tosca playlist configuration. Without it, test results will not be associated with your pipeline.
{% endhint %}
{% endstep %}

{% step %}

### Wait for SeaLights to process the results

Wait approximately **2 minutes** for SeaLights to process the Footprints data from the test execution.
{% endstep %}

{% step %}

### Observe coverage in the SeaLights dashboard

Open the SeaLights Coverage Report for your application. Verify that the ABAP components exercised by your tests are showing as covered.

You should see:

* The ABAP components (Programs, Functions, Classes) that your tests exercised listed as covered.
* If no coverage appears, verify that the `SeaLightsLabId` matches your pipeline and that the Footprints task is running.

<figure><img src="/files/DEDlJN2Mx37VaS9qmg0J" alt="SeaLights Coverage Report showing covered ABAP components."><figcaption><p>The Coverage Report shows which ABAP components are covered by Tosca tests.</p></figcaption></figure>
{% endstep %}

{% step %}

### Enable Test Optimization (TIA)

Enable Test Optimization for your application in the SeaLights dashboard. This tells SeaLights to recommend only the tests impacted by code changes instead of the full test suite.
{% endstep %}

{% step %}

### Enable continuous Build Modifications monitoring

Configure the agent to continuously monitor the QAS system for transports. From this point on, the agent will automatically create a Build Modification in SeaLights whenever a transport is imported into the QAS system.

{% hint style="success" %}
The agent is now fully configured. It will continuously monitor for code changes and collect test coverage data.
{% endhint %}
{% endstep %}

{% step %}

### Ongoing operation

From this point on, run your tests in Tosca with the SeaLights integration enabled. SeaLights will automatically recommend which tests to skip based on the code changes detected by the agent.

After each transport import, the agent creates a Build Modification within five minutes. Subsequent test runs will only execute tests impacted by the changes.
{% endstep %}
{% endstepper %}

## Troubleshooting

For additional help, see [Troubleshooting the ABAP Agent](/sealights-agents-and-plugins/abap-agent/troubleshooting-the-abap-agent.md).

## What's next?

* [Configuration settings](/sealights-agents-and-plugins/abap-agent/configuration-settings.md) -- advanced tuning options for the ABAP Agent.
* [Command-line interface](/sealights-agents-and-plugins/abap-agent/command-line-interface.md) -- full reference for all CLI commands.
