> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# Type Alias: GetByRole\<T _extends_ `HTMLElement` = `HTMLElement`>

> **GetByRole**\<`T` _extends_ `HTMLElement` = `HTMLElement`> = (`container`: `HTMLElement`, `role`: [`ByRoleMatcher`](/next/api/react/testing-library/Type_Aliases/ByRoleMatcher.md), `options?`: [`ByRoleOptions`](/next/api/react/testing-library/Interfaces/ByRoleOptions.md)) => `T`

## Type Parameters

| Type Parameter              | Default type  |
| --------------------------- | ------------- |
| `T` _extends_ `HTMLElement` | `HTMLElement` |

## Parameters

| Parameter   | Type                                                                             |
| ----------- | -------------------------------------------------------------------------------- |
| `container` | `HTMLElement`                                                                    |
| `role`      | [`ByRoleMatcher`](/next/api/react/testing-library/Type_Aliases/ByRoleMatcher.md) |
| `options?`  | [`ByRoleOptions`](/next/api/react/testing-library/Interfaces/ByRoleOptions.md)   |

## Returns

`T`
