# Test Case Templates

> Use test case templates as base models for your test cases. For example, you can create a template with [data variations](https://docs.uipath.com/studio/standalone/latest/user-guide/data-driven-testing) to be reused on different tests. You can create test case templates for Test Automation projects, including other file types such as Global Exception Handler. For other projects (e.g., Process), you can create workflow templates.

Use test case templates as base models for your test cases. For example, you can create a template with [data variations](https://docs.uipath.com/studio/standalone/latest/user-guide/data-driven-testing) to be reused on different tests. You can create test case templates for Test Automation projects, including other file types such as Global Exception Handler. For other projects (e.g., Process), you can create workflow templates.

## Conditions

* The templates are specific to the project type and the language that is used to create it.
* The templates cannot be converted to workflows, compiled, or published.
* You can make use of reusable content by [creating a library](https://docs.uipath.com/studio/standalone/latest/user-guide/creating-basic-library#creating-a-basic-library) with test case templates. Test data variation is not exported to the library alongside the test case template.
  :::important
  The resources referenced in the template will not be copied locally to the project where you are trying to import the library. The template should not contain references to other assets, such as workflows within the library.
  :::

## Template Sources

When you add a new file, you can choose a template on which to base it. The templates that you can choose from vary depending on the type of file you are adding (workflow or test case) and on whether you have previously added templates to your project **Templates** folder.

## Adding a Local File Template

You can use the contextual menu in the **Project** panel to manually add [execution](https://docs.uipath.com/studio/standalone/latest/user-guide/execution-templates#execution-templates), and test case templates based on other templates to your project. After you add a template, you can edit it in the Designer, and then use it as a starting point for creating other files.

  ![docs image](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-168369-f67c0d68.webp)

* To add a test case template, right-click the **Templates** folder, and then select **Add** &gt; **Test Case Template**. Follow the [test case creation process](https://docs.uipath.com/studio/standalone/latest/user-guide/application-testing-test-cases#test-cases) to configure the template.

  ![docs image](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-166728-cd23d199.webp)
* To add an execution template, right-click the **Templates** folder, and then select **Add** &gt; **Execution Template**.

  ![docs image](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-168917-591c470f.webp)

### Extract File as Template

1. Create a **Test Automation** project.
2. Open a test case you would want to extract as a template.
3. In the **Project** panel, right-click a test case and select **Extract as template**.

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-167965-06a40c5b.webp)

You test case is now stored in **Project** &gt; **Templates**. You can copy and paste or move it back to your testing folder.

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-170411-3551dcd9.webp)

:::note
* You can create templates directly from the **Templates** folder for your test cases and workflows.
* You can use the contextual menu within the **Templates** folder to perform various actions, such as [comparing files](https://docs.uipath.com/studio/standalone/latest/user-guide/comparing-files#comparing-files).
:::

### Test Case Templates in Libraries

You can create test case templates in libraries the same way you create them in processes. After you [publish the library](https://docs.uipath.com/studio/standalone/latest/user-guide/about-publishing-automation-projects#about-publishing-automation-projects), the templates marked as public are available as **package file templates** in projects where the library is installed.

## Creating a Test Case From a Template

1. Create a project of type **Test Automation**.
2. Build whatever test case you would like to use as a template.
3. When you finish building the test case, right-click it, and select **Extract as Template**. Name the template, choose the **Templates** folder as the location to store it in, and select **Create**. For this example, the name of the template is **MyFirstTestCaseTemplate**.

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-172524-ef860d3f.webp)
4. Go to the **Design** tab, in the **File** group, select **New** &gt; **Test Case**. The **New Test Case** window is displayed.

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-166516-e849d3e5.webp)
5. Give it an appropriate name, and select the template that you previously created from the **Template** dropdown list. For this example, choose **MyFirstTestCaseTemplate**.

## Removing a Template

To remove a template, expand the **Templates** folder in the Project panel, right-click the template, and then select **Delete**.
