{"record":{"id":"3414b7b449db1a8e","repo":"grafana/k6","slug":"querying-all-selectors-q-w","errorCode":null,"errorMessage":"querying all selectors %q: %w","messagePattern":"querying all selectors %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/element_handle.go","lineNumber":1272,"sourceCode":"\t\treturn nil, fmt.Errorf(\"querying all selector %q: %w\", selector, err)\n\t}\n\n\treturn handles, nil\n}\n\nfunc (h *ElementHandle) queryAll(selector string, eval evalFunc) (_ []*ElementHandle, rerr error) {\n\tparsedSelector, err := NewSelector(selector)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parsing selector %q: %w\", selector, err)\n\t}\n\tresult, err := eval(\n\t\th.ctx,\n\t\tevalOptions{forceCallable: true, returnByValue: false},\n\t\tjs.QueryAll,\n\t\tparsedSelector,\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"querying all selectors %q: %w\", selector, err)\n\t}\n\tif result == nil {\n\t\t// it is ok to return a nil slice because it means we didn't find any elements.\n\t\treturn nil, nil\n\t}\n\n\thandles, ok := result.(JSHandleAPI)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"getting element handle for selector %q: %w\", selector, ErrJSHandleInvalid)\n\t}\n\tdefer func() {\n\t\tif err := handles.Dispose(); err != nil {\n\t\t\terr = fmt.Errorf(\"disposing element handles: %w\", err)\n\t\t\trerr = errors.Join(err, rerr)\n\t\t}\n\t}()\n\n\tprops, err := handles.GetProperties()","sourceCodeStart":1254,"sourceCodeEnd":1290,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/element_handle.go#L1254-L1290","documentation":"Returned by ElementHandle.queryAll when evaluating the injected QueryAll script against the element's subtree fails. Identical failure class to the outer wrapper: the page-side evaluation errored (context destroyed, JS exception, or CDP error), not a selector-matching failure — no matches returns nil slice without error.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/element_handle.go:1272 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry once the page/frame is stable","Verify the element handle belongs to a live frame","Look at the wrapped error to distinguish a JS exception from a session error"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}