> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/integrations/sample-integrations/integrating-test-executions-from-various-testing-frameworks.md).

# Integrating Test Executions from various Testing Frameworks

You can integrate any Testing Framework with Sealights using our Public API to capture Tests Events like Start and End of Test Stage, Tests results, etc.\
We’re listing below some examples of integrations for your reference.

{% hint style="warning" %}
The sample code listed in this article is **not supported by Sealights as an official plugin**, agent, or product and is shared as a courtesy.
{% endhint %}

## Sealights Integration samples repository <a href="#sealights-integration-samples-repository" id="sealights-integration-samples-repository"></a>

Sealights had published a repository of several sample integrations on Github:

{% embed url="<https://github.com/Sealights/sealights-integration-examples>" %}

## Known Third Party Integrations <a href="#known-third-party-integrations" id="known-third-party-integrations"></a>

### Robot Framework Sealights Custom Listener <a href="#robot-framework-sealights-custom-listener" id="robot-framework-sealights-custom-listener"></a>

<figure><img src="/files/Wbt0pwHXEy1Z6hEdX1BS" alt=""><figcaption></figcaption></figure>

This section demonstrates applying SeaLights with Test Optimization to tests executed with the Robot framework (Python): It uses a [reference implementation of the Robot Listener interface](https://github.com/Sealights/sealights-integration-examples/tree/main/robot-custom-integration) to facilitate calls to SeaLights API at appropriate phases of the test suite's lifecycle. The SeaLights integration is implemented in the file `SLListener.py` available as an[ open-source project ](https://github.com/Sealights/sealights-integration-examples/tree/main/robot-custom-integration)for you to be able to customize it to your specific configuration.

By default, the command line to add the Sealights' listener to the Robot execution is as follows: `--listener “SLListener.py:<Token>:<buildSessionId>:<Test Stage Name>:<(optional) LabId>:<(optional) testProjectId>”`.

The command arguments are specified after the listener name (or path) using a colon (`:`) as a separator:

* Token
* buildSessionId
  * Note: if using a LabId, you do not need to provide a buildSessionId. In this case leave the `<buildSessionId>` argument blank. This will result in double colon where bsid would have been. (e.g. `--listener “SLListener.py:<Token>::<Test Stage Name>:<LabId>”` )
* Test Stage name
* (Optional) LabId
* (Optional) TestProjectId

For example:

{% code overflow="wrap" lineNumbers="true" %}

```
robot --listener "SLListener.py:`cat sltoken.txt`:`cat buildSessionId.txt`:Robot Tests:qa.green.lab.id" some_tests.robot
```

{% endcode %}

or

{% code overflow="wrap" lineNumbers="true" %}

```
robot --listener "SLListener.py:${SL_TOKEN}:${SL_BUILD_SESSION_ID}:Robot Tests:${SL_LAB_ID}" some_tests.robot
```

{% endcode %}

{% hint style="info" %}
For more information about Robot Framework Interfaces, please refer to the official documentation: [Robot Framework User Guide](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#listener-interface)
{% endhint %}

### Katalon Studio Sealights plugin <a href="#katalon-studio-sealights-plugin" id="katalon-studio-sealights-plugin"></a>

This plugin is publicly available on [Katalon Store](https://store.katalon.com/product/267/Sealights-Integration).

<figure><img src="https://media-cdn.atlassian.com/file/4b17aa16-e549-42a4-8f96-c622860d45e7/image/cdn?allowAnimated=true&#x26;client=3e13f527-bb33-4594-9a72-07b5021724fc&#x26;collection=contentId-1725267986&#x26;height=152&#x26;max-age=2592000&#x26;mode=full-fit&#x26;source=mediaCard&#x26;token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIzZTEzZjUyNy1iYjMzLTQ1OTQtOWE3Mi0wN2I1MDIxNzI0ZmMiLCJhY2Nlc3MiOnsidXJuOmZpbGVzdG9yZTpjb2xsZWN0aW9uOmNvbnRlbnRJZC0xNzI1MjY3OTg2IjpbInJlYWQiXX0sImV4cCI6MTc1NTAwNTg3MSwibmJmIjoxNzU1MDAyOTkxLCJhYUlkIjoiNzEyMDIwOmE0YjUyYjA5LTM3NDYtNGY0Ni1hNzZlLTk5ZTI1ZWE0Nzg4ZiJ9.6pQH6Olq7fcIaEc_hRFFem7bfK3OUoBHHUnJGRTc99s&#x26;width=760" alt=""><figcaption></figcaption></figure>

### Ginger by Amdocs <a href="#ginger-by-amdocs" id="ginger-by-amdocs"></a>

Since Release 4.5, Ginger by Amdocs has the ability to integrate with Sealights using a built-in plugin and allows to:

* Publish Automation execution data to Sealights, to deliver Faster, High-Quality, and controlled releases
* Get Test Recommendations from Sealights for Ginger Runset execution to optimize the efforts and reduce testing cycle time

{% hint style="info" %}
More details are available in the dedicated section on the Ginger documentation portal: [Ginger-Sealights Integration](https://ginger-automation.github.io/Ginger-Web-Help/assets/Ginger_By_Amdocs/Integrations/Ginger-Sealights_Integration.htm)
{% endhint %}

<figure><img src="https://media-cdn.atlassian.com/file/7f66d1e0-d37b-4beb-b4bc-bb956219f01f/image/cdn?allowAnimated=true&#x26;client=3e13f527-bb33-4594-9a72-07b5021724fc&#x26;collection=contentId-1725267986&#x26;height=262&#x26;max-age=2592000&#x26;mode=full-fit&#x26;source=mediaCard&#x26;token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIzZTEzZjUyNy1iYjMzLTQ1OTQtOWE3Mi0wN2I1MDIxNzI0ZmMiLCJhY2Nlc3MiOnsidXJuOmZpbGVzdG9yZTpjb2xsZWN0aW9uOmNvbnRlbnRJZC0xNzI1MjY3OTg2IjpbInJlYWQiXX0sImV4cCI6MTc1NTAwNTg3MSwibmJmIjoxNzU1MDAyOTkxLCJhYUlkIjoiNzEyMDIwOmE0YjUyYjA5LTM3NDYtNGY0Ni1hNzZlLTk5ZTI1ZWE0Nzg4ZiJ9.6pQH6Olq7fcIaEc_hRFFem7bfK3OUoBHHUnJGRTc99s&#x26;width=760" alt=""><figcaption></figcaption></figure>

## Sample Code <a href="#sample-code" id="sample-code"></a>

### Converting Results Report from XML <a href="#converting-results-report-from-xml" id="converting-results-report-from-xml"></a>

Several frameworks provide the ability to report the results of test executions into an XML format that can be reused to feed Sealights.

For example, the **Windows Powershell** commands below allow to convert a TestNG XML format into the JSON format expected by Sealights API.

{% hint style="info" %}
If your Testing Frameworks uses TestNG, please prefer Sealights' Out-Of-the-Box integration with TestNG. If your framework simply outputs its result in this format, the sample below is relevant for you.
{% endhint %}

{% code overflow="wrap" lineNumbers="true" %}

```
$SealightsJson = ConvertTo-Json -InputObject @( [xml]$(Get-Content -Path .\testng-results.xml) | Select-Xml -XPath "//test-method" |foreach {
    [PSCustomObject]@{
        name = $_.node.signature
		start = ([DateTimeOffset](Get-Date $($_.node.'started-at'))).ToUnixTimeMilliseconds()
		end = ([DateTimeOffset](Get-Date $($_.node.'finished-at'))).ToUnixTimeMilliseconds()
		status = $(if ($_.node.status -eq 'PASS') { 'passed' } else { $(if ($_.node.status -eq 'FAIL') { 'failed' } else { 'skipped' }) })
    }
} ) )
```

{% endcode %}

If you’re converting an NUnit XML report, you’ll be mapping `test-case` object and its following properties: `fullname`, `start-time`, `end-time`, and `result` (with values `Passed`, `Failed`, and `Skipped`)

{% hint style="warning" %}
For better accuracy of Sealights Test Optimization, please make sure to set your **XML report timestamps in milliseconds**.\
For example, you can change the parameter `timestampFormat` in your XML Reporter settings from `yyyy-MM-dd'T'HH:mm:ss'Z'` to `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`, for that purpose.
{% endhint %}

### &#x20;<a href="#handling-unexpected-closure-of-testing-executions" id="handling-unexpected-closure-of-testing-executions"></a>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/integrations/sample-integrations/integrating-test-executions-from-various-testing-frameworks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
