Skip to content
masterclass Buddy

React Testing Library · Module

getAllByLabelText

getAllByLabelText finds all form controls connected to matching label text. It returns an array and throws when no control matches.

Last updated

Syntax

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

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

Subscribe
  • getByLabelText
  • queryByLabelText
  • getAllByLabelText
  • queryAllByLabelText
  • findByLabelText
  • findAllByLabelText
  • getByRole
  • screen

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