# 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="https://2916937215-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRc4KTKGprZI2sPWKoaLe%2Fuploads%2Fp3T7bouReUygVZhmEuAF%2Fimage02.webp?alt=media&#x26;token=06cc6da5-60a3-44f4-907e-63aaa881a049" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

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

<figure><img src="https://2916937215-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRc4KTKGprZI2sPWKoaLe%2Fuploads%2FDzZVmRtbY5zj3qIuKL5r%2Fimage.png?alt=media&#x26;token=6f9bf377-18fd-4401-ab34-9ca8ff7f50ef" 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.
