Skip to content
masterclass Buddy

React Testing Library · Module

queryByTitle

queryByTitle checks for an element with a matching HTML title attribute or SVG title element. It returns the element when found and null when absent.

Last updated

Syntax

queryByTitle(container: HTMLElement, title: TextMatch, options?: { exact?: boolean; normalizer?: NormalizerFn }): HTMLElement | null

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

Subscribe
  • getByTitle
  • getAllByTitle
  • queryAllByTitle
  • findByTitle
  • findAllByTitle
  • screen
  • within

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