DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
Testing Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
medium
Testing
Why is `screen.getByRole` preferred over `screen.getByTestId` or class queries?
A
Because role queries execute faster
B
Because querying by ARIA roles mimics screen reader outputs, verifying that the interface is structurally accessible to all users
C
Because test IDs are forbidden in production builds
D
Because CSS class selectors are deleted in ESM
Check Answer