Skip to content
masterclass Buddy

React Testing Library · Module

getAllByTestId

getAllByTestId returns every element matching a test ID. It throws if no matching element is found.

Last updated

Syntax

getAllByTestId(container: HTMLElement, text: TextMatch, options?: { exact?: boolean; normalizer?: NormalizerFn }): HTMLElement[]

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • getByTestId
  • queryByTestId
  • queryAllByTestId
  • findByTestId
  • findAllByTestId
  • screen
  • within
  • configure

Source: ByTestId | Testing Library. Checked 2026-11-03.