# Grouping steps

## Why group your steps?

If you work on a large amount of test cases and complex user flows, you need to [organize your tests](https://docs.bugbug.io/organizing-tests) and keep your project nice and tidy.&#x20;

Use "step groups" to make sure you can easily navigate in large projects. Most importantly **you need to use groups to use** [**components**](https://docs.bugbug.io/editing-tests/components)**.**

{% hint style="info" %}
**Important! All steps are always inside a group**\
In BugBug all your steps are always in some kind of a group. By default when you record a test, all your steps will be in just one "Unnamed group" that you can later split into more groups.&#x20;
{% endhint %}

## Creating a group

The most productive way is to use "Split group here" action.&#x20;

1. Move your mouse between the step rows
2. Click the "plus" icon
3. Click "Split here"
4. Name the group

![](https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2FUNrwsakVHrH2jbpQlAZC%2Fsplit-group-here.png?alt=media\&token=bfe1fa8f-6b4e-48fd-b3bc-d034de8b7c83)

**Result:** you will get 2 new groups. The first one keeps the old name. You can immediately rename the new group.

![](https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2FNxgUS7tpQl6Qtw3iS14z%2Fgroup-edit-name.png?alt=media\&token=4355b8cb-c62e-42c2-b0f4-d78e3696d340)

![](https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2Fu5P8pdRWAS3iyInE8UJo%2Fgroup-named.png?alt=media\&token=df51deb1-b0ab-425c-88d0-43a328b4c428)

You can have multiple groups in one test. Each group can be converted to [components - reusable test steps that allow you to edit multiple tests at once.](https://docs.bugbug.io/editing-tests/components)

![](https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2F1JhwQ5GahZ9n9owyt3qz%2FScreenshot%202022-04-11%20at%2016.49.48.png?alt=media\&token=0afc8018-be3c-4507-9e94-433cd46a2a08)

## Renaming a group

Click the name of the group - that's it, you can edit the name. No need to click "Save" button.

## Groups vs. components

Groups are just organizing your test steps. They become powerful when you convert them to [components - a group of steps that is shared across multiple tests](https://docs.bugbug.io/editing-tests/components).


---

# Agent Instructions: 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:

```
GET https://docs.bugbug.io/editing-tests/grouping-steps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
