···2727const locator = page.getByText('Hello, World', { exact: true })
2828await locator.click()
2929```
3030+3131+## browser.locators.errorFormat <Version>5.0.0</Version> {#browser-locators-errorformat}
3232+3333+- **Type:** `'html' | 'aria' | 'all'`
3434+- **Default:** `'all'`
3535+3636+Controls what Vitest prints when a locator cannot find an element. Vitest prints information for the DOM subtree where the locator search ran, or `document.body` for page-level locators.
3737+3838+- `'html'` prints that DOM subtree as HTML using [`utils.prettyDOM`](/api/browser/context#prettydom).
3939+- `'aria'` prints that DOM subtree as an [ARIA snapshot](/guide/browser/aria-snapshots), which focuses on accessible roles, names, and state.
4040+- `'all'` prints the ARIA snapshot first, followed by the HTML output.
4141+4242+```ts
4343+import { defineConfig } from 'vitest/config'
4444+4545+export default defineConfig({
4646+ test: {
4747+ browser: {
4848+ enabled: true,
4949+ locators: {
5050+ errorFormat: 'aria',
5151+ },
5252+ },
5353+ },
5454+})
5555+```
5656+5757+For example, `all` displays a following error:
5858+5959+```html
6060+VitestBrowserElementError: Cannot find element with locator: getByRole('button', { name: 'Save' })
6161+6262+ARIA tree:
6363+- main:
6464+ - heading "Settings" [level=1]
6565+ - button "Cancel"
6666+6767+HTML:
6868+<body>
6969+ <main>
7070+ <h1>
7171+ Settings
7272+ </h1>
7373+ <button>
7474+ Cancel
7575+ </button>
7676+ </main>
7777+</body>
7878+```