# API Reference Complete function signatures and parameters for all aria-testing query functions. ## Query Function Signatures All query functions accept a `container` (Element, Fragment, or Node) and return matching elements. ### By Role ```python get_by_role( container: Element | Fragment | Node, role: str, /, *, name: str | re.Pattern[str] | None = None, level: int | None = None, ) -> Element query_by_role( container: Element | Fragment | Node, role: str, /, *, name: str | re.Pattern[str] | None = None, level: int | None = None, ) -> Element | None get_all_by_role( container: Element | Fragment | Node, role: str, /, *, name: str | re.Pattern[str] | None = None, level: int | None = None, ) -> list[Element] query_all_by_role( container: Element | Fragment | Node, role: str, /, *, name: str | re.Pattern[str] | None = None, level: int | None = None, ) -> list[Element] ``` **Parameters:** - `container`: The root element/fragment/node to search within - `role`: ARIA role name (e.g., "button", "link", "heading") - `name`: Optional accessible name to match (string or regex pattern) - `level`: Optional heading level (1-6, only valid for role="heading") **Returns:** - `get_by_*`: Single Element (raises if zero or multiple found) - `query_by_*`: Element or None (raises if multiple found) - `get_all_by_*`: List of Elements (raises if none found) - `query_all_by_*`: List of Elements (empty list if none found) **Raises:** - `ElementNotFoundError`: When `get_by_*` or `get_all_by_*` finds no matches - `MultipleElementsError`: When `get_by_*` or `query_by_*` finds multiple matches ### By Text ```python get_by_text( container: Element | Fragment | Node, text: str | re.Pattern[str], /, *, exact: bool = True, ) -> Element query_by_text( container: Element | Fragment | Node, text: str | re.Pattern[str], /, *, exact: bool = True, ) -> Element | None get_all_by_text( container: Element | Fragment | Node, text: str | re.Pattern[str], /, *, exact: bool = True, ) -> list[Element] query_all_by_text( container: Element | Fragment | Node, text: str | re.Pattern[str], /, *, exact: bool = True, ) -> list[Element] ``` **Parameters:** - `container`: The root element/fragment/node to search within - `text`: Text to match (string or regex pattern) - `exact`: If True, text must match exactly (after normalization). If False, substring matching is used **Returns/Raises:** Same as role queries ### By Label Text ```python get_by_label_text( container: Element | Fragment | Node, text: str | re.Pattern[str], /, *, exact: bool = True, ) -> Element query_by_label_text( container: Element | Fragment | Node, text: str | re.Pattern[str], /, *, exact: bool = True, ) -> Element | None get_all_by_label_text( container: Element | Fragment | Node, text: str | re.Pattern[str], /, *, exact: bool = True, ) -> list[Element] query_all_by_label_text( container: Element | Fragment | Node, text: str | re.Pattern[str], /, *, exact: bool = True, ) -> list[Element] ``` **Parameters:** - `container`: The root element/fragment/node to search within - `text`: Label text to match (string or regex pattern) - `exact`: If True, text must match exactly (after normalization). If False, substring matching is used **Returns/Raises:** Same as role queries **Note:** Searches for `