---
title: "Manage Directory View of Test Case"
language: "en"
url: "https://docs.testany.io/en/docs/manage-directory-view-of-test-case/"
markdown_url: "https://docs.testany.io/en/docs/manage-directory-view-of-test-case.md"
translation: "https://docs.testany.io/zh/docs/manage-directory-view-of-test-case.md"
last_updated: "2026-03-26T15:39:24+08:00"
---

# Manage Directory View of Test Case

## 1. Overview

The **Directory View** feature in Testany is built on the concept of labels, providing a folder-like hierarchical structure for visually organizing and browsing test cases. Unlike a traditional filesystem, where folders determine file locations, this directory view leverages **labels** to determine **which directories (or "folders") a test case appears in**, making the classification and display more flexible.

### **Core Principle of the Directory View**

#### **Label-Driven Directory Structure**

- Each directory in the view has a name that corresponds to a Testany label of the same name.
- If a test case has labels matching this directory and all of its parent directories, it will appear under that directory in the hierarchy.


> **Info**
>
> 'TestCaseLibrary' is the build-in root directory that typically exists by default and does not directly correspond to any label. It cannot be removed.


#### **One-to-Many Mapping**

- Because a test case can hold multiple labels, it can appear under multiple directories (or multiple hierarchy levels) at once.
- When a test case has multiple label sets that meet different directory requirements, the test case can appear in all matching directories.

### **Advantages of the Directory View**

#### **More Intuitive Hierarchy**

- By representing related labels as parent and child directories, users can quickly grasp the "directory → subdirectory → test case" structure at a glance, reducing the complexity that can sometimes occur in a flat label system.

#### **Compatibility with Existing Labels**

- The directory view does not alter how labels are stored at the data level. Rather, it "aggregates and displays" test cases that share the same label(s) on the pages. You don't need to migrate or modify your existing test cases to benefit from this approach.

#### **Flexible Organization**

- A single test case can match multiple directory rules, effectively creating "soft links" so that the test case can appear under several directories.
- Users can add, remove, or modify labels at any time, and the directory view will instantly update to reflect these changes in structure.

### Two Main Filtering Modes

#### **Cumulative View**

In Cumulative View, when you select a directory, the list of test cases on the right **includes test cases from that directory as well as all of its subdirectories**. In other words, if a test case appears in any subdirectory, it will also appear in the parent directory's test case list.

#### **Exclusive View**

In Exclusive View, the list of test cases on the right **only shows those directly associated with the chosen directory**, excluding any subdirectory content. Put simply, only test cases explicitly labeled for this directory (and not just its subdirectories) will be displayed in the list.

**Example:**

Here is the active directory structure:

```text
TestCaseLibrary
 └─ API
     ├─ Auth
     └─ Payment
         ├─ Refund
         └─ History
```

There are test cases with the following labels:

- **ABCD0001**: with labels `API`, `Payment`
- **ABCD0002**: with labels `API`, `Payment`, `Refund`
- **ABCD0003**: with labels `API`, `Payment`, `History`
- **ABCD0004**: with labels `API`, `Auth`
- **ABCD0005**: with labels `Regression`, `Auth`
- **ABCD0006**: with no label

In **Cumulative View**, each directory will display the test cases as follows.

| **Directory** | | | | **Logic** | **Case Keys** |
| --- | --- | --- | --- | --- | --- |
| `TestCaseLibrary` |  |  |  | Show all test cases in the system | `ABCD0001`, `ABCD0002`, `ABCD0003`, `ABCD0004`, `ABCD0005`, `ABCD0006` |
|  | `API` |  |  | Show test cases labeled with `API` | `ABCD0001`, `ABCD0002`, `ABCD0003`, `ABCD0004` |
|  |  | `Auth` |  | Show test cases labeled with `API`, `Auth` | `ABCD0004` |
|  |  | `Payment` |  | Show test cases labeled with `API`, `Payment` | `ABCD0001`, `ABCD0002`, `ABCD0003` |
|  |  |  | `Refund` | Show test cases labeled with `API`, `Payment`, `Refund` | `ABCD0002` |
|  |  |  | `History` | Show test cases labeled with `API`, `Payment`, `History` | `ABCD0003` |

In **Exclusive View**, each directory will display the test cases as follows.

| **Directory** | | | | **Logic** | **Case Keys** |
| --- | --- | --- | --- | --- | --- |
| `TestCaseLibrary` |  |  |  | Show test cases without any label | `ABCD0006` |
|  | `API` |  |  | Show test cases labeled with `API` but **without** `Auth` & `Payment` | - |
|  |  | `Auth` |  | Show test cases labeled with `API`, `Auth` | `ABCD0004` |
|  |  | `Payment` |  | Show test cases labeled with `API`, `Payment` but **without** `Refund` & `History` | `ABCD0001` |
|  |  |  | `Refund` | Show test cases labeled with `API`, `Payment`, `Refund` | `ABCD0002` |
|  |  |  | `History` | Show test cases labeled with `API`, `Payment`, `History` | `ABCD0003` |

## 2. **How-To**

### **Creating or Modifying a Directory**

When you create a new directory in the directory view, you're effectively adding a label of the same name (if it doesn't already exist). If you choose to nest this new directory under an existing directory, you define a **parent-child relationship** in the **visual hierarchy**.

### **Having a Test Case Appear Under a Directory**

To place a test case in a specific directory, simply **assign the label corresponding to that directory** to the test case. If the directory is nested, you'll also need to assign labels for its ancestor directories so that Testany recognizes the full path. Once these labels are in place, the test case automatically appears at the appropriate level in the directory view.

### **Appearing in Multiple Directories**

If a test case holds multiple sets of labels corresponding to different directory structures, the test case will appear under all of those directories. This is especially helpful for cross-functional or more complex scenarios where a test case might be relevant to multiple categories.

### **Removing a Test Case**

If you remove a directory-related label (or one of its parent directory labels) from a test case, that test case will no longer appear in that directory in the view.

## 3. Steps-by-steps Guide

### 3.1 Pre-steps

#### 3.1.1 Navigate to Directory View

Navigate to the Directory View in the Test Case Library.

![image-20250402-075223.png](https://docs.testany.io/docs/images/en/image-20250402-075223_d2f18b6f.png)

### 3.2 Manage Directory View List


> **Info**
>
> All changes are saved automatically. You can also click the **"Synced"** button if needed.


#### 3.2.1 New a Directory View

Expand Directory View List dropdown and click '+ New Structure'. A directory view named "New Structure 1" is created by default.

![Manage Directory View of Test Case - new.gif](https://docs.testany.io/docs/images/en/Manage_Directory_View_of_Test_Case_-_new_0777ee76.gif)

#### 3.2.2 Rename a Directory View

1. Expand Directory View List dropdown.
2. Click the pencil icon next to the directory view you wish to rename.
3. Type the new name.
4. Click ✅ to save.

![Manage Directory View of Test Case - rename.gif](https://docs.testany.io/docs/images/en/Manage_Directory_View_of_Test_Case_-_rename_92c0ef8d.gif)

#### 3.2.3 Set an Active Directory View

1. Expand Directory View List dropdown.
2. Select the directory view you want to set as active.

The current Directory View will update to the selected view.

#### 3.2.4 Delete a Directory View


> **Note**
>
> This action is irreversible. Please proceed with caution.


1. Expand Directory View List dropdown
2. Click 'x' button next to the directory view you want to delete.
3. Click 'Delete' in the confirmation popup.

A success message will appear above the Directory View List dropdown once deletion is complete.

![Manage Directory View of Test Case - delete.gif](https://docs.testany.io/docs/images/en/Manage_Directory_View_of_Test_Case_-_delete_d6c0b2ca.gif)

### 3.3 Manage Directory Structure

#### 3.3.1 Add a subdirectory

1. Select the directory to which you want to add a subdirectory.
2. Hover on the right side of the directory name and click the '+' button.

   ![image-20250402-094952.png](https://docs.testany.io/docs/images/en/image-20250402-094952_26eb75b9.png)
3. In the Add Subdirectory pop-up, search for an existing label or type a new name to create one.
4. Click 'Done'.

![Test Case Tree View - add subdirectory.gif](https://docs.testany.io/docs/images/en/Test_Case_Tree_View_-_add_subdirectory_a956fd5e.gif)

#### 3.3.2 Reorder directory

##### 3.3.2.1 Move a directory into another (as a subdirectory)

1. Select the parent directory into which you want to move the target directory.
2. Drag the target directory over the parent directory until a **blue dotted outline** highlights the parent, then release.

Example: Moving `PLP` under `happy_path`: drag `PLP` onto `happy_path` until a blue dashed box highlights `happy_path`.

![image-20250402-095439.png](https://docs.testany.io/docs/images/en/image-20250402-095439_78a2b6fb.png)

##### 3.3.2.1 Mov**e a directory to higher level**

1. Select the directory you want to move to a higher (parent) level.
2. Drag it to the target area (e.g. between two sibling directories or under/above a sibling directory) until a **blue dotted box** appears exactly where you want the directory placed, then release.

Example: Moving `happy_path` to the same level of `bookings` and between `bookings` and `PLP`.

![Manage Directory View of Test Case - move as parent dir.gif](https://docs.testany.io/docs/images/en/Manage_Directory_View_of_Test_Case_-_move_as_paren_0f88117c.gif)

##### 3.3.2.1 Reorder directory in the same level

1. Select the directory you want to reorder within the same level.
2. Drag it until a **blue dotted box** appears in the desired position, then release.

Below screenshot illustrated moving `PLP` between `membership` and `bookings`.

![Manage Directory View of Test Case - reorder dir.gif](https://docs.testany.io/docs/images/en/Manage_Directory_View_of_Test_Case_-_reorder_dir_16cf101f.gif)

#### 3.3.2 Delete a directory

1. Select the directory to which you want to delete.
2. Hover on the right side of the directory name and click the 'x' button.
3. In the Delete Directory pop-up, click 'Delete'

### 3.4 Switch Filter

Click the 'Filter' button to switch between **Cumulative View** and **Exclusive View**.

**Cumulative View**

![image-20250403-111314.png](https://docs.testany.io/docs/images/en/image-20250403-111314_7c5db1bc.png)

**Exclusive View**

![image-20250403-111337.png](https://docs.testany.io/docs/images/en/image-20250403-111337_95e7eb8c.png)

×

## Glossary terms on this page

- [Test Case](https://docs.testany.io/en/docs/glossary.md#test-case)
- [User](https://docs.testany.io/en/docs/glossary.md#user)
- [Cumulative View](https://docs.testany.io/en/docs/glossary.md#cumulative-view)
- [Exclusive View](https://docs.testany.io/en/docs/glossary.md#exclusive-view)
- [Test Case Library](https://docs.testany.io/en/docs/glossary.md#test-case-library)
