> 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/ai-features/crawl-requirements.md).

# Generate Requirements from a Crawl

## Quick answer

How to generate test cases in ContextQA by having an AI agent crawl your live application — from an AI Insights activity or from a new requirement — and how to read the crawl requirement it produces. Use this page to understand when the capability applies, complete its user-facing workflow, and verify the expected result.

## What this page covers

{% hint style="info" %}
**Who is this for?** Testers, SDETs, and QA managers who want an AI agent to walk their live application and build test cases from what it finds, either starting from a discovered user activity or from scratch.
{% endhint %}

A **crawl** hands a task to an AI agent that navigates your live application in a browser, then generates test cases from what it finds. Every crawl produces a **crawl requirement** — the record the generated test cases are created from, which preserves the context the crawl started from.

You can start a crawl two ways:

* **From an AI Insights activity** — turn a discovered user activity into test cases. See [AI Insights](/ai-features/ai-insights.md).
* **From a new requirement** — describe a flow yourself and let the agent explore it.

Both paths produce the same kind of crawl requirement, which you read the same way.

***

## Starting a crawl from AI Insights activities

When you generate test cases from one or more activities in an AI Insights report, the **Generate test cases** drawer opens. Its subtitle explains the model: **Each selected activity produces its own requirement.** Nothing is merged across activities.

The drawer is a four-step flow.

### 1. Analysis

Analysis starts as soon as the drawer opens, so you review what the AI actually found before configuring anything. For each activity it works out the prerequisite steps and the clarifications worth asking, and summarizes them in a **What the AI found** card.

Activities that have already produced a requirement are skipped. If every activity you selected has already been generated, the drawer shows an **Already generated** state instead — close it and pick at least one activity that hasn't been generated yet.

When the analysis finishes, click **Continue to clarifications**.

### 2. Clarifications

Each activity that needs a decision shows one or more questions. The AI's recommended answer is preselected, so change only what you disagree with — or choose **Other** to enter your own answer. A progress indicator tracks how many questions you have answered, and **Use recommended** resets every answer to the AI's suggestion.

You can also attach a prerequisite step the generated tests should reuse. When nothing needs deciding, the step shows **Nothing needs deciding** and you can carry on.

Click **Continue to inputs**.

### 3. Inputs

Review the selected activities and edit the **start URL** for each one. Expand **Show Configuration Options** to set how the tests are generated (see [Crawl configuration options](#crawl-configuration-options) below), and optionally add extra context.

Click **Start crawls**.

### 4. Crawl

ContextQA creates one crawl requirement and one live crawl session per activity. Each row shows its status and links to the requirement it produced:

| Status                | Meaning                                                    |
| --------------------- | ---------------------------------------------------------- |
| **Crawling**          | The crawl is running.                                      |
| **Already generated** | The activity already had a requirement, so it was skipped. |
| **Failed**            | The crawl couldn't start.                                  |

You can close the drawer once crawls start — each requirement fills in as its own crawl completes. Use **View live crawl** to watch a running crawl, or **View requirement** to open the result.

***

## Starting a crawl from a new requirement

You can also start a crawl without an AI Insight.

1. Open the **New Requirement** dialog from the requirements library.
2. On the **Choose how you'd like to generate your test cases** screen, select **Generate from Crawl** and click **Get started**.
3. Complete the **Inputs** step, then start the crawl.

The Crawl flow has two steps: **Inputs** and **Crawl**.

### Inputs

Fill in the crawl inputs:

* **Target URL** — where the crawl starts. It becomes the first step of the crawl, so it is always required, for example `https://app.example.com/login`.
* **What should the crawl explore?** — the task handed to the AI agent, for example "Sign in, add a product to the bag, apply a coupon and complete checkout." Use the **Example Prompts** below the field for inspiration.
* **Name this requirement** *(optional)* — leave blank to name it after the date and time the crawl started.
* **Additional context** *(optional)* — anything the AI should know that isn't in the instructions above.

Expand **Show Configuration Options** to set the generation options described below.

Click **Start Crawl**. ContextQA creates the requirement and a live browser session, then shows the result card with a link to the requirement (`REQ-<id>`) and a **View live crawl** button while the crawl runs. You can close the dialog — the crawl continues in the background and the requirement fills in as it completes.

{% hint style="info" %}
On the Free plan, crawls are limited to the demo URLs ContextQA provides. Any other URL is rejected with a "URL Not Allowed" message.
{% endhint %}

### Crawl configuration options

Both crawl paths share the same configuration options:

| Option                         | What it controls                                                                                                                                                                                                                                             |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Select Target Platform**     | The platform the generated tests target. A live crawl always runs in a browser, so **Web Application** is the only available platform; **Mobile** and **API** are disabled.                                                                                  |
| **Publish Mode**               | **Require approval** keeps generated tests in a draft state until you review them. **Auto publish** publishes them automatically after analysis.                                                                                                             |
| **Test case types**            | The types of test cases the AI generates — **All Types**, or any of **Positive / Happy Path**, **Negative**, **Edge Cases**, **Field Level Validation**, **Boundary Value**, **Functional**, and **End to End**. If you select none, the AI decides for you. |
| **Prerequisites** *(optional)* | Test cases that must run before every test case this crawl generates, for example "User is logged in." They do not replace the target URL, which the crawl always starts from.                                                                               |
| **Create Test Suite**          | Add the generated tests to a new suite, named in **Test Suite Name**.                                                                                                                                                                                        |
| **Create Test Plan**           | Add the generated tests to a new plan, named in **Test Plan Name**, with an option to **Execute Test Plan**.                                                                                                                                                 |

{% hint style="info" %}
Tests awaiting approval cannot be added to a suite or plan. To use **Create Test Suite** or **Create Test Plan**, set **Publish Mode** to **Auto publish**.
{% endhint %}

***

## Reading a crawl requirement

Open a crawl requirement to review what the crawl captured and generated. A crawl requirement is marked with an **AI Insights** badge and adds crawl-specific content to two tabs.

### Metadata tab

The **Metadata** tab shows two sections for a crawl requirement:

* **Generation Information** — the activity title and platform, plus capture stats drawn from the source activity: **Console Errors**, **Steps Executed**, **Pages Visited**, **Test Cases**, and **Version**.
* **Configurations** — **Publish Mode**, **Environment**, **Test Case Types**, **Test Suite**, and **Test Plan**.

### Requirement Data tab

The **Requirement Data** tab has two sub-tabs:

* **Sources & Context** — traces the requirement back to the AI Insight and the activity it came from. A capture card shows the source **Insight** (as a link), when it was **Generated**, and the platform. A **Captured activity** entry lists when it was captured, its step count, its console error count, and its priority, with a **What I considered** note from the AI. If no source context exists, the tab shows "No source context."
* **AI Analysis** — summarizes the generation pass, including **AI Understanding**, **Assumptions Made**, **Coverage Notes**, **Warnings & Gaps**, and a **Confidence Score**.

***

## Summary

Crawling turns a live walkthrough of your application into test cases:

1. **Start** a crawl from an AI Insights activity or from a new requirement.
2. **Configure** the target, the task, the platform, and how the results are published.
3. **Run** the crawl in the background while the requirement fills in.
4. **Review** the crawl requirement's metadata, sources, and AI analysis.

***

## Related pages

* [AI Insights](/ai-features/ai-insights.md) — discover the activities users take and generate tests for the gaps
* [AI Test Generation](/ai-features/ai-test-generation.md) — generate test cases from tickets, URLs, designs, and other sources
* [Requirements Coverage Gaps](/ai-features/requirements-coverage-gaps.md) — find requirements that lack test coverage


---

# 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/ai-features/crawl-requirements.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.
