Error24 reports
Fix TestingLibraryElementError
in Kibana
✅ Solution
The "TestingLibraryElementError" typically arises when `getBy*` or `findBy*` queries fail to locate an element that is expected to be present in the DOM at a given point in the test. To resolve this, ensure the element you're querying for is actually rendered (check conditional rendering, asynchronous updates) and use `waitFor` or `findBy*` to handle asynchronous rendering, or consider using `queryBy*` if the element might not always be present and handle the `null` return value.
Related Issues
Real GitHub issues where developers encountered this error:
Failing test: Jest Tests.x-pack/solutions/observability/plugins/apm/public/components/shared/service_map - HighlightWrapper search overrides context highlight uses search highlight test subject insteaMay 25, 2026
Failing test: Jest Tests.x-pack/solutions/observability/plugins/apm/public/components/shared/service_map - HighlightWrapper active search match sets the search highlight test subjectMay 25, 2026
Failing test: Jest Tests.x-pack/solutions/observability/plugins/apm/public/components/app/trace_link - TraceLink calculates time range from transaction when not provided in queryMay 25, 2026
Failing test: Jest Tests.x-pack/solutions/observability/plugins/apm/public/components/app/trace_link - TraceLink redirects to transaction page with date range and waterfall paramsMay 25, 2026
Failing test: Jest Tests.x-pack/solutions/observability/plugins/apm/public/components/app/trace_link - TraceLink redirects to traces page when no transaction is foundMay 25, 2026
Timeline
First reported:May 25, 2026
Last reported:May 25, 2026