> 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/build/creatingscript.md).

# Test Scripts

A test script is one test. It is an ordered list of [test steps](/web-testing/build/creatingsteps.md) — open a page, click a button, check that something appeared.

Scripts live inside modules. See [Test Repository](/web-testing/build/creatingmodule.md).

## Prerequisites

* A project and a module. See [Creating a Project](/web-testing/project-creation/create-project.md) and [Test Repository](/web-testing/build/creatingmodule.md).

## Three ways to create a script

| Method                                                   | Use it when                                                                                                 |
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| [Manually](#creating-a-script-manually)                  | You know what the test should do and will write the steps yourself                                          |
| [Test Generator](#creating-a-script-with-test-generator) | You want the steps drafted for you, from a Jira, Rally or Azure DevOps item, or from a description you type |
| [TestGenerator+](#creating-scripts-with-testgenerator)   | You already have scripts and want more, covering scenarios you have missed                                  |

All three end the same way: a script in your module, ready for you to open and refine.

## Creating a script manually

1. On the module's page, click **New Script**.

   ![The New Script button](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-f401f8286c5293cb37550047b55f56f84c04cef0%2Ftgv2-module-new-script.png?alt=media)
2. Choose **Create Manually**.

   ![Choosing Create Manually](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-6c4695017a8008bf5ece546e6383a129c8a76d40%2Ftgv2-create-manually.png?alt=media)
3. Fill in the panel:
   * **Test Script Name** — what the test does, in a few words
   * **Objective** — a sentence saying what it checks
   * **Tags** — optional labels for grouping. See [Tags](/web-testing/analyze/tags.md)
4. Click **Create Script**.

   ![The new script panel](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-08cf06c3f207137030e9b5d5275c2d8ffe4cfaaf%2Ftgv2-manual-test.png?alt=media)
5. The script appears in the module, with no steps yet.

   ![The script listed in the module](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-1a383713051365cbd0c146fb4112ea90833f250c%2Ftgv2-manual-test-save.png?alt=media)

Now open it and add steps — see [Test Steps](/web-testing/build/creatingsteps.md).

## Creating a script with Test Generator

**Test Generator** drafts a script for you. You give it either a ticket from your issue tracker or a description of what you want tested, and it proposes test scenarios and, if you ask, the steps to go with them.

It connects to **Jira**, **Rally** and **Azure DevOps**.

### Memory (beta)

**Memory** is an option you can switch on with either method. It lets the generator look at tests already run against the same website, so the steps it writes match how your application actually behaves.

|                         | What you get                                                                                                                     |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **Memory off**          | The right actions — click, enter, verify — but placeholder values for the elements. Expect to tidy the steps before running them |
| **Memory on**           | Values reused from tests that previously ran against that URL, so steps are usually ready to run                                 |
| **First time on a URL** | The same as Memory off. There is nothing to reuse yet. It improves as more tests run against that URL                            |

### Starting the generator

1. On the module's page, click **New Script**.

   ![The New Script button](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-f232089ea0ae4e982268a82bbf25c0f8c08c5e7f%2Ftgv2-new-script-2-stage.png?alt=media)
2. Choose **Test Generator**.

   ![Choosing Test Generator](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-3f26767fc74c239318a12bd3e0a41fd1bd6ea6f7%2Ftgv2-test-generator-start.png?alt=media)
3. Under **Select Method**, choose where the scenarios should come from — **Integrations** for a ticket, or **Using Description** to type what you want.

## From Jira

You need a Jira configuration first. See [Jira](/web-testing/integrations/jira.md).

1. Under **Select Method**, choose **Integrations**, then **Jira** from **Select Integration**.
2. Choose the configuration to use from **Select Configuration**.
3. In **Enter Issue ID**, type the Jira issue to generate from.
4. Optionally tick **Use Step Data from Memory (Beta)** and give the website **URL**.
5. Click **Generate Test Scripts**.

   ![Generating from a Jira issue](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-a03d0d4cfecff53fabff5953b86f99b7aced8989%2Ftgv2-jira.png?alt=media)
6. Review the scenarios it proposes.

   ![The generated scenarios](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-29c3c894cce35af0e6b3bb7f94ac129ebeb5ece4%2Ftgv2-generate-scenarios.png?alt=media)

### Exporting with or without steps

You now have a choice.

**Export the scenarios as they are.** Select the ones you want, click **Export Test Script(s)**, then **Export Scripts** to confirm. You get scripts with no steps, ready for you to fill in.

![Exporting scenarios](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-0fa54744e0e76b000e8863f9fb983db50e93b3c8%2Ftgv2-export-scenarios.png?alt=media)

**Or have the steps written first.** Click **Generate Steps**.

![Generating steps](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-51077a724ea850bc27b2b90ea6e9023f813b555e%2Ftgv2-generate-steps.png?alt=media)

Progress shows across two tabs, **Steps Pending** and **Steps Ready**. **Stop Step Generation** cancels it.

![Steps being generated](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-2ca0359d3585cc520ff4dcc18e677ddaecbeca2f%2Ftgv2-streaming-steps.png?alt=media)

**You do not have to wait on this screen.** Generation keeps running if you go elsewhere in Qyrus, and you are notified when it finishes.

When it is done, the step-counter button on each scenario opens the steps for review. Then export with **Export Test Script(s)** → **Export Scripts**.

![Generated steps](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-c47f7753b245093eca2a711a768c33392d46380c%2Ftgv2-steps-generated.png?alt=media)

### Why each step is there

Every generated step has an **ⓘ** icon. It tells you two things:

* **Reason** — why the step was included, and whether it was reused from an earlier test or newly written.
* **Path** — if it was reused, which project, module and script it came from.

This means anyone reviewing the script can see why a step exists, not just the person who generated it.

![A step's reason and path](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-84adef81a9a02a9463db1d65bc71677b4e65a019%2Ftgv2-step-reason-path.png?alt=media)

### After exporting

A notification appears with **View Script(s)**, which jumps straight to what you created.

![The view scripts notification](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-254129ed8e1a37d9412a295feca6815b00f2bb87%2Ftgv2-view-exported-scripts.png?alt=media)

To start over, click **Reset** beside **Test Scripts** and confirm.

![The Reset button](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-19dbefd8c90518583842edbde4719a7b261b7fd0%2Ftgv2-reset.png?alt=media)

![Confirming a reset](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-28638b9eaf8da34004d3fe031c7c864a968bc477%2Ftgv2-reset-dialog.png?alt=media)

## From Rally

You need a Rally configuration first. See [Integrations](/web-testing/integrations.md).

1. Under **Select Method**, choose **Integrations**, then **Rally**.
2. Choose your configuration from **Select Configuration**.
3. Choose the **Select Workspace** to read from.
4. In **Enter Issue ID**, type the Rally item.
5. Optionally tick **Use Step Data from Memory (Beta)** and give the website URL.
6. Click **Generate Test Scripts**.

   ![Generating from Rally](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-07795d7ea7c02cba7e4d2033532876376159b058%2Ftgv2-rally.png?alt=media)

From here it works exactly as [From Jira](#from-jira).

## From Azure DevOps

You need an Azure DevOps configuration first. See [Integrations](/web-testing/integrations.md).

1. Under **Select Method**, choose **Integrations**, then **Azure**.
2. Choose your configuration from **Select Configuration**.
3. In **Work Item ID**, type the Azure DevOps work item.
4. Optionally tick **Use Step Data from Memory (Beta)** and give the website URL.
5. Click **Generate Test Scripts**.

   ![Generating from Azure DevOps](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-ca57cf8170ca2b588416aa1edd3e5ec638e5b31e%2Ftgv2-azure.png?alt=media)

From here it works exactly as [From Jira](#from-jira).

## Using a description

No issue tracker needed — describe what you want tested.

1. Under **Select Method**, choose **Using Description**.
2. Type what the test should cover in **Use Case Description**. Be specific: the more detail you give, the closer the scenarios land.

   ![Entering a description](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-3823856965091330ce575f71d41ea3c2d1049a9a%2Ftgv2-user-description.png?alt=media)
3. Optionally tick **Use Step Data from Memory (Beta)**.

   ![The Memory checkbox](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-4071ac046c85af85f80f48fe8e86e7bf62d29b7b%2Ftgv2-memory-check.png?alt=media)

   A **URL** field appears — give the website you want the tests written against.

   ![Providing the website URL](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-31b7f3b864771e422cc622e6dd5438d6ecd80337%2Ftgv2-app-url.png?alt=media)
4. Click **Generate Test Scripts**.
5. Review the scenarios, then export with or without steps exactly as in [From Jira](#from-jira).

Scripts made this way carry the Test Generator icon in the module list, so you can tell them from ones written by hand.

## Creating scripts with TestGenerator+

**TestGenerator+** works the other way round. Instead of starting from a ticket, it reads scripts you already have and proposes more — covering scenarios your existing tests miss.

### Prerequisites

* A module with at least one script that has a clear objective. TestGenerator+ reads the objective to work out what is missing.

### Generating

1. Click **TestGenerator+** on the module's script page.

   ![The TestGenerator+ button](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-4c472ad368e631ed8c773e8c198efbaaa1d4d405%2Fbuild-testgen-01.png?alt=media)
2. The service opens. The left column lists the scripts in the module — these are what the AI reads. Tick the one or ones to start from. **Generate** stays greyed out until you pick at least one.

   ![Choosing a baseline script](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-ed0dd2aea43eb53925fb6cf7fcd54d4c796c08ba%2Fbuild-testgen-02.png?alt=media)
3. Click **Generate** and wait. It takes about a minute, and the button reads **Generating** while it works.
4. Review what it proposes. Each suggestion is labelled **MEDIUM**, **HIGH** or **CRITICAL** — criticality is how much it would matter if that feature broke, so use it to decide what is worth keeping.

   The arrow at the end of a row opens its detail on the right: **Script Objective**, **Criticality Description** and **Criticality**.

   ![Reviewing a generated script](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-74a25bcde69dd46a8cdb84ba31507d47f06b3ec1%2Fbuild-testgen-03.png?alt=media)

   Expect more suggestions than you want. One login script produced twenty-three, ranging from password errors to session handling.
5. Tick the ones you want and click **Add Scripts**. It is greyed out until you select something.

   ![Adding the generated scripts](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-dfb9da30cefe254e4cb5abc424b7a5f16e566931%2Fbuild-testgen-04.png?alt=media)
6. You are returned to the module, where the new scripts sit alongside your own and carry the TestGenerator+ icon.

   ![A generated script in the module](https://239974709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FycS61vFhJMvvtnJCrDJk%2Fuploads%2Fgit-blob-3d475bc83d30c1cf95bcd11e7886321c5ca23ec5%2Fbuild-testgen-05.png?alt=media)

**Generated scripts arrive with no steps.** What TestGenerator+ writes is the name and the objective — the thinking about *what* to test. Turning that into a working test is still your job: open each one and add the steps. See [Test Steps](/web-testing/build/creatingsteps.md).

## Where to go next

A script with no steps does nothing. Open it and add some.

| To read about                                  | Go to                                                           |
| ---------------------------------------------- | --------------------------------------------------------------- |
| Adding the steps that make up the test         | [Test Steps](/web-testing/build/creatingsteps.md)               |
| Checking the test works                        | [Dry Run](/web-testing/run/dryrun.md)                           |
| Renaming, cloning, moving and deleting scripts | [Managing Test Scripts](/web-testing/build/scriptoperations.md) |
| Organising scripts into modules                | [Test Repository](/web-testing/build/creatingmodule.md)         |
