> For the complete documentation index, see [llms.txt](https://docs.akto.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akto.io/test-editor/how-to/add-test-role-in-editor.md).

# Add Test Role in Editor

## Overview

You can associate a **test role** with a test to control which API role or context Akto uses while executing the test. Associating a test role helps align test execution with role-based access patterns observed in production traffic.

## Steps to Add a Test Role

{% stepper %}
{% step %}
Log in to the Akto dashboard and navigate to **Test Library**.
{% endstep %}

{% step %}
Open the **Test Editor** by clicking **Editor**.
{% endstep %}

{% step %}
Select the test you want to edit from the list.
{% endstep %}

{% step %}
Click the **API name box** in the top-right corner.

<figure><img src="/files/NslWXQJrFQXxsNDxj7O2" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
In the dialog, choose the desired **test role** from the available options.

<figure><img src="/files/0RXMOKHuyhQI0t92D8AG" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click **Save** to apply the test role to the test.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
**Test role selection is available only in the Akto Testing module.**
{% endhint %}

## Result of Test Role Association

The selected test role becomes associated with the test configuration. Akto uses the selected role context when executing the test against the chosen API, which helps ensure role-aware security validation.


---

# 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.akto.io/test-editor/how-to/add-test-role-in-editor.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.
