Skip to content
masterclass Buddy

React Testing Library · Module

getAllByAltText

getAllByAltText returns all elements with matching alt text. It throws when no element matches.

Last updated

Syntax

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

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

Subscribe
  • getByAltText
  • queryByAltText
  • queryAllByAltText
  • findByAltText
  • findAllByAltText
  • screen
  • TextMatch

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