> For the complete documentation index, see [llms.txt](https://learning.contextqa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learning.contextqa.com/web-testing/managing-test-cases.md).

# Managing Test Cases

## Quick answer

Open a case from **Test Cases** to review its steps, variables, relationships, run history, and **Created by** owner before changing shared coverage. Edit metadata or steps from the detail page, use **Duplicate** for a safe starting copy, and use **Delete** to move a case to recoverable Trash. **Delete Forever** is available only from Trash and permanently removes the case and its run history.

You manage a ContextQA test case from its details page. Open a case to inspect its steps and metadata, update it, make a copy, or move it to Trash. Use these procedures when maintaining automated coverage after requirements or application behavior change.

## Prerequisites

* You can access the appropriate workspace and workspace version.
* Your role includes the action you intend to perform. A missing or disabled control can indicate a permission or feature restriction.
* For destructive testing, use a disposable case whose name clearly identifies it, such as `DOCS-DELETE-ME — Temporary deletion example`.

## Open and inspect a test case

1. Select **Test Cases** in the left navigation.
2. In the **Test Cases** list, locate the case by its `TC-` identifier or title.
3. Select the test case row or title.
4. Review **Test Steps**, **Relationships**, or **Version History**.
5. In the side panel, review **Test Case**, **Variables**, **Used in Test**, and **Run History**.

The details page shows the case name, status, priority, **Created by**, creation date, environment, version, platform, description, and execution and AI configuration. Use **Created by** to identify the owner to contact before changing or retiring shared coverage.

## Edit test case metadata

1. Open the test case.
2. Select **Edit** in the **Description** section.
3. Update the description, **Status**, **Priority**, **Type**, or labels.
4. Update execution, AI, wait and retry, device, or key-flag settings only when the test requires them.
5. Select **Save Changes**.
6. Confirm the new values appear in the **Test Case** panel.

ContextQA enables **Save Changes** after a value changes. Select **Cancel** to discard changes made in the edit form.

## Rename a test case

1. Open the test case.
2. Select the edit icon beside the test case name.
3. Enter the new name.
4. Confirm the change using the control shown by the inline editor.
5. Verify the new name appears in the header and in the **Test Cases** list.

Use names that describe one observable outcome, for example `Authentication — Sign in — Invalid password`.

## Edit test steps

Use the **Test Steps** tab to add, edit, reorder, or remove actions and assertions. Verify the final sequence and review **Version History** after saving. For field-level instructions, see [Edit test steps](/web-testing/test-steps-editor.md).

## Duplicate a test case

1. Open the source test case.
2. Open the three-dot actions menu in the header.
3. Select **Duplicate**.
4. In **Copy Test Case**, leave **Test Case** selected.
5. Replace the default `copy of (...)` name with a name that describes the new behavior.
6. Select **Create**.
7. Confirm the copied case opens and a **Test Case copied successfully** notification appears.

The same dialog can copy the content as a **Step Group**. Use that option only when the copied steps are a reusable sequence rather than an independently executable scenario.

## Move a test case to Trash

Deleting a test case first moves it to Trash. This operation is recoverable.

1. Confirm that you opened the intended case. For research or cleanup, confirm its name includes `DOCS-DELETE-ME`.
2. Open the three-dot actions menu.
3. Select **Delete**.
4. In **Delete Test Case**, review the test case name and the message that the case can be restored from Trash.
5. Select **Yes, Delete**.
6. Confirm the **Test Case deleted successfully** notification appears.

## Restore a deleted test case

In **Trash (Deleted Test Cases)**, each row's **More actions** menu shows **View**, **Restore**, and **Delete**. Restore a case directly from its row, or from the read-only trashed case page.

### Restore from the case row

1. Select **Test Cases** in the left navigation.
2. Open the **All Test Cases** selector and select **Trash (Deleted Test Cases)**.
3. Locate the deleted case and open its **More actions** menu.
4. Select **Restore**.
5. Confirm the **Test Case restored successfully** notification appears.
6. Return to **All Test Cases** and verify the case is present and editable.

### Restore from the trashed case page

1. In **Trash (Deleted Test Cases)**, open the case's **More actions** menu and select **View**.
2. On the read-only **Trashed Test Case** page, select **Restore**.
3. Return to **All Test Cases** and verify the case is present and editable.

## Permanently delete a test case

{% hint style="danger" %}
**Delete Forever cannot be undone.** ContextQA warns that all run reports and run configuration associated with the test case will be lost.
{% endhint %}

1. Open **Test Cases** and select **Trash (Deleted Test Cases)**.
2. Open the trashed test case with **More actions** > **View**.
3. Confirm that the page identifies it as the exact disposable case you intend to remove.
4. Select **Delete Forever**.
5. In **Delete Test Case**, review the permanent-deletion warning.
6. Enter `delete` in **Type 'delete' to confirm**.
7. Select **Yes, Delete**.
8. Verify the case no longer appears in Trash.

## Practical example

Suppose `Authentication — Sign in — Valid credentials` needs an invalid-password variant. Duplicate the case, rename the copy `Authentication — Sign in — Invalid password`, replace the success assertion with an error-message assertion, and save. If the copy is not needed, move only the copy to Trash; keep the original and its run history intact.

## Troubleshooting

| Problem                                  | Likely cause                                          | Resolution                                                           |
| ---------------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------- |
| **Save Changes** is disabled             | No editable value has changed                         | Change a field, or select **Cancel** to leave edit mode.             |
| A trashed case cannot be edited          | Trashed cases are read-only                           | Select **Restore**, then edit the active case.                       |
| The case is missing from the active list | It may be in Trash or hidden by search/filter state   | Clear search and filters, then check **Trash (Deleted Test Cases)**. |
| **Delete Forever** is disabled           | The confirmation text is missing or incorrect         | Enter the lowercase word `delete` exactly.                           |
| An action is missing or disabled         | Your role or workspace configuration may not allow it | Ask a workspace administrator to confirm your permissions.           |

## Limitations and permissions

* The current UI exposes **Duplicate**, **Delete**, **Restore**, and **Delete Forever**. It does not expose a separate **Archive** action on the tested case.
* A trashed test case is read-only until restored.
* Permanent deletion removes run reports and run configuration and has no undo action.
* Permission differences were not safely testable with the available administrator session; do not infer access from role names alone.

## Related documentation

* [Create test cases](/web-testing/creating-test-cases.md)
* [Find and organize test cases](/web-testing/finding-and-organizing-test-cases.md)
* [Edit test steps](/web-testing/test-steps-editor.md)
* [Manage test suites](/web-testing/managing-test-suites.md)

## Frequently asked questions

### Does ContextQA save test case metadata automatically?

No. In the verified metadata editor, you select **Save Changes**. The button becomes available after a value changes.

### Can I restore a deleted test case?

Yes. A normal **Delete** moves the case to **Trash (Deleted Test Cases)**, where you can select **Restore** directly from the case row's **More actions** menu or from its read-only page.

### What happens when I permanently delete a test case?

ContextQA removes the case and warns that its run reports and run configuration will be lost. The action cannot be undone.


---

# 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://learning.contextqa.com/web-testing/managing-test-cases.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.
