# How Re:agent uses a browser

> What Re:agent can do on a page, and what each step in the chat means.

Source: https://rehearsal.dev/docs/reagent/browser

Re:agent uses your app in Chromium, on Rehearsal's servers. It reads the page, acts on it, and reads it again, one step at a time.

After every step, Re:agent sees the page as it stands: its address, its title and the elements on it. It also sees the newest errors in the browser console and any requests that failed.

## What it can do

| Step | What Re:agent does |
| --- | --- |
| Open a page | Goes to an address. |
| Click | Clicks a button, a link or another element. |
| Fill in a field | Types into a field, and can press Enter after. |
| Press a key | Presses one key, such as Enter or Escape. |
| Choose an option | Picks an option in a list. |
| Scroll | Scrolls one screen up or down. |
| Wait | Waits up to a minute for text or an address to appear. |
| Read | Reads the text of one element. |
| Read the test inbox | Reads new email for the test account. See [The test inbox](https://rehearsal.dev/docs/reagent/test-inbox.md). |
| Switch tabs | Moves to another tab of the same browser. |
| Attach a file | Uploads a project file. See [Files for uploads](https://rehearsal.dev/docs/reagent/files.md). |

## Steps in the chat

Each thing Re:agent does is one row in its reply. Rehearsal writes the words of every row, not Re:agent, so a row says only what happened.

A row names what it acted on, as the page names it, such as **Clicked Save changes**. A password is never shown in a row.

When a step does not work, the row says so, such as **Clicking Save changes did not work**. Re:agent reads the page as it is and decides what to do next. A step that did not work does not end the reply.

When Re:agent leaves a page, its rows fold into one line with the page's name and what was done there. When the reply ends, the whole list folds into one line, such as **Worked for 2m 10s · opened a browser and took 14 steps**. Click a line to open it.

## The browser panel

The browser appears beside the chat while Re:agent works. If the panel is closed, press **Show preview** to open it.

- The panel shows the page live, with its steps under it.
- The buttons at the top make the panel bigger or full screen.
- With several browsers, each has its own card. **Follow the agent** brings you back to the one Re:agent is using.
- **Waiting** means Re:agent finished its reply. The browser keeps its page for your next message.
- When every browser has closed, the panel says **Recordings**. You can replay each session there, also after you reload the page.

## Limits

- Each browser takes up to 60 steps in one flow. Then Re:agent has to save the flow or close the browser.
- Re:agent takes one step at a time, in one browser at a time.
- Browsers start signed out. Re:agent signs in with a test account, so signing in is part of the flow.
- A password field takes only the test account's password. See [Test accounts and secrets](https://rehearsal.dev/docs/reagent/test-accounts.md).
- A CAPTCHA stops Re:agent. Turn it off for your test accounts or your test environment.
- A browser that waits a long time for your next message closes. Re:agent then has to start the flow again in a new browser.
- An app on your computer must stay connected through the CLI while Re:agent uses it.

## Next steps

- Give Re:agent [a test account](https://rehearsal.dev/docs/reagent/test-accounts.md) for flows that sign in.
- Test [flows with more than one person](https://rehearsal.dev/docs/reagent/more-than-one-person.md), each in a browser of their own.
