# Automation Testing

Use the `setExitStatus.py` Python script, attached to this page, to test and simulate the use of the automation triggers within Clarity LIMS.

{% hint style="info" %}
The `setExitStatus.py` script is designed to illustrate concepts for API training purposes. Do not use in a production environment.

The `setExitStatus.py` script relies on the presence of the `glsapiutilv2.py` script. Typically, both scripts are located in the same directory.
{% endhint %}

The `setExitStatus.py` script uses the following command-line parameters:

<table data-header-hidden><thead><tr><th width="166"></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td>-u {user}</td><td>LIMS username</td><td></td></tr><tr><td>-{password}</td><td>LIMS password</td><td></td></tr><tr><td>-l {stepURI}</td><td>LIMS stepURI—the URI of the transient step API resource that invokes the script.</td><td></td></tr><tr><td>-s {status}</td><td>The status the script is reporting (OK, WARNING, or ERROR).</td><td></td></tr><tr><td>-m {message}</td><td>The descriptive message displayed to the user.</td><td></td></tr></tbody></table>

An example of a parameter string that invokes this script from Clarity LIMS is provided in the following. Note the use of the stepURI token in the -l parameter.

`python /opt/gls/clarity/customextensions/setExitStatus.py -l {stepURI:v2:http} \`

`-u {username} -p {password} -s "OK" -m "successful"`

#### Attachments

glsapiutilv2.py:

{% file src="<https://2084401275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfjuebS41N49G1Eh55hP7%2Fuploads%2Fgit-blob-80cee67b4f7421665ec342a63a1e8be42ecfa0c1%2Fglsapiutilv2.py?alt=media&token=f029e2df-bfad-4344-995a-9cce3e55224b>" %}

setExitStatus.py.txt:

{% file src="<https://2084401275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfjuebS41N49G1Eh55hP7%2Fuploads%2Fgit-blob-9344c12ae3334d04bcc06674f99f3c9a355f4c41%2FsetExitStatus.py?alt=media&token=92d7214a-1528-4c5f-bab8-9e85122678f0>" %}

The latest glsapiutil (and glsapiutil3) Python libraries can be found on the [GitHub](https://github.com/Illumina/BaseSpace_Clarity_LIMS) page.


---

# Agent Instructions: 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:

```
GET https://help.connected.illumina.com/clarity-lims/api-and-database/api-docs/automation/automation-testing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
