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