> For the complete documentation index, see [llms.txt](https://docs.drizz.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.drizz.dev/fathom/how-fathom-works.md).

# How Fathom Works

Fathom operates through a continuous AI-driven execution loop. Once a test intent is provided, the agent analyzes the application state at each step, determines the required action, and proceeds through the UI until the scenario is complete.

#### 1. Intent Interpretation

The user provides a natural language description of the test scenario. Fathom parses this intent to determine the sequence of actions required to fulfill the objective.

#### 2. Step-by-Step Execution

Fathom executes the test on the connected local emulator one step at a time. At each step, the agent:

1. Analyzes the current application state
2. Determines the next required action
3. Performs the interaction on the emulator UI
4. Advances to the next step

#### 3. Conditional Logic Detection

When the intent implies conditional behavior — for example, actions that depend on a specific application state — Fathom automatically identifies these conditions and represents them as IF blocks in the generated script.

This ensures the output script accurately reflects the dynamic behavior of the application rather than a single linear path.

#### 4. Validation Capture

If validation requirements are specified as part of the intent or provided during the run, Fathom captures them and appends the corresponding validation commands to the generated script.

Examples of captured validations:

1. Verifying the presence of a UI element
2. Confirming successful navigation to a screen
3. Checking for expected text or messages

#### 5. Script Generation

At the conclusion of a successful run, Fathom produces a structured test script containing:

1. The full sequence of UI actions performed
2. Conditional steps inferred from the intent
3. Validation commands (if defined)
4. Contextual navigation steps required to complete the flow


---

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

```
GET https://docs.drizz.dev/fathom/how-fathom-works.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.
