Skip to content
masterclass Buddy

React Testing Library · Module

findByPlaceholderText

Use getByPlaceholderText to find an input by its placeholder value. Prefer a label query when the control has a label.

Last updated

Syntax

getByPlaceholderText(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
  • queryByPlaceholderText
  • getAllByPlaceholderText
  • queryAllByPlaceholderText
  • findByPlaceholderText
  • findAllByPlaceholderText
  • getByLabelText
  • screen

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