> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.doc-detective.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.doc-detective.com/_mcp/server.

# saveState

> Reference for the `saveState` schema.

## Referenced In

* [test](/reference/schemas/test)
* [Resolved context](/reference/schemas/resolved-context)

## Fields

| Field     | Type                                                                                       | Description                                                                                                                                                  | Default |
| :-------- | :----------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- | :------ |
| saveState | one of: - string - object([Save state (detailed)](/reference/schemas/save-state-detailed)) | Required. Save the open site's cookies and `localStorage` to a JSON file in Playwright's `storageState` format, so later tests can sign in with `loadState`. | —       |

## Examples

```json
{
  "saveState": "auth.json"
}
```

```json
{
  "saveState": {
    "path": "auth.json",
    "directory": "../.auth",
    "overwrite": true
  }
}
```