> For the complete documentation index, see [llms.txt](https://docs.qyrus.com/web-testing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.qyrus.com/web-testing/advanced-features/importsteps.md).

# Import and Export Scripts

You can export a test script to a file and import it back — into another module, another project, or another Qyrus organisation. It is the quickest way to share a script with a colleague or to move work between environments.

Scripts export as **XLSX** or **JSON**. Both round-trip: what you export can be imported again.

## Prerequisites

* A test script. See [Test Scripts](/web-testing/build/creatingscript.md).

## Exporting a script

1. Open the script.
2. Click **Export as** in the toolbar and choose **Export XLSX** or **Export JSON**.

   ![The Export as menu](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-99b09a55e5d3bd21acddb584ae7ad7f711f67f39%2Fadvanced-importexport-01.png?alt=media)
3. The file downloads through your browser.

## Importing steps into a script

1. Open the script you want the steps to go into.
2. In the **Info** panel on the right, under **Actions**, use **Import File (XLSX,JSON)** and choose your file.

   ![The Import File control](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-7bb9e3b76962caa9467aa20f6f006b3d2f499c6e%2Fadvanced-importexport-02.png?alt=media)

The steps from the file are added to the script.

## Two actions that do not survive a round trip

When you build test step data from a template, two user actions are **not** supported:

* File Upload
* Execute Test Case

They are still included when you export. What happens on import depends on where the file lands:

| Imported into                       | What happens                                                                                       |
| ----------------------------------- | -------------------------------------------------------------------------------------------------- |
| The same project                    | The file upload data and the execute test case step stay valid                                     |
| A different project or organisation | Both become invalid. Upload the file again, and reselect the script for the execute test case step |

## Function steps in the file

Exported files carry a **Test\_Step\_Number** field for function steps, saying which parent step each one belongs to. To add a step to an existing function, add it to the function steps sheet with the **Test\_Step\_Number** of the **Execute Function** step it belongs to.

## Adding a new function through the file

You can create a whole new function from the file:

1. Add the function's steps to the function steps sheet.
2. Add a parent step to the `testStep` sheet with its user action set to **Execute Function**.
3. In that parent step's **Step\_Data**, put a unique UUID. Any UUID generator will do. A UUID Qyrus has not seen before is what tells it to create a new function.

The function is created in Project Setup, named from the parent step's **Step Description**, and imported into the script when the import finishes.

## What happens to functions on import

**Importing into the same project**

* The existing function is reused.
* Any new steps you added in the file are added to the imported function *and* to the main function in Project Setup.
* Any parent step number you removed from the file is updated in the project's main function, but still added to the execute function step.

**Importing into a different project**

* If a function of the same name already exists, Qyrus creates a new one named `<function name>_import <timestamp>` using the steps in your file, and the script points at that.
* If no function of that name exists, it creates one under the original name.

Either way, steps you added to the file are created.

## Where to go next

| To read about                         | Go to                                                    |
| ------------------------------------- | -------------------------------------------------------- |
| Building functions in the first place | [Functions](/web-testing/advanced-features/functions.md) |
| Creating and editing scripts          | [Test Scripts](/web-testing/build/creatingscript.md)     |
