{"record":{"id":"75546185e9bef14f","repo":"grafana/k6","slug":"pressing-q-on-element-w","errorCode":null,"errorMessage":"pressing %q on element: %w","messagePattern":"pressing %q on element: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/element_handle.go","lineNumber":1179,"sourceCode":"\n\tframe, ok := h.frame.manager.getFrameByID(node.FrameID)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"no frame found for id %s\", node.FrameID)\n\t}\n\n\treturn frame, nil\n}\n\n// Press scrolls element into view and presses the given keys.\nfunc (h *ElementHandle) Press(key string, opts *ElementHandlePressOptions) error {\n\tpress := func(apiCtx context.Context, handle *ElementHandle) (any, error) {\n\t\treturn nil, handle.press(apiCtx, key, KeyboardOptions{})\n\t}\n\tpressAction := h.newAction(\n\t\t[]string{}, press, false, withRetry, opts.NoWaitAfter, opts.Timeout,\n\t)\n\tif _, err := call(h.ctx, pressAction, opts.Timeout); err != nil {\n\t\treturn fmt.Errorf(\"pressing %q on element: %w\", key, err)\n\t}\n\n\tapplySlowMo(h.ctx)\n\n\treturn nil\n}\n\n// Query runs \"element.querySelector\" within the page. If no element matches the selector,\n// the return value resolves to \"null\".\nfunc (h *ElementHandle) Query(selector string, strict bool) (_ *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\n\t// Check for frame navigation in the selector\n\tframeNavIndex := h.findFrameNavigationIndex(parsedSelector)\n\tif frameNavIndex != -1 {","sourceCodeStart":1161,"sourceCodeEnd":1197,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/element_handle.go#L1161-L1197","documentation":"Returned by ElementHandle.Press after the internal key-press action (scroll into view, actionability checks, key dispatch via newAction with retry) fails within the configured timeout. The wrapped error carries the real cause: element not visible/enable/editable, hit-target interception, timeout, or a detached element.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/element_handle.go:1179 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase the timeout option for press()","Wait for the element to be visible and stable before pressing (waitForSelector)","Use force:true to bypass actionability checks if overlays/animations intercept the hit target","Ensure the element is not disabled or covered by another element"],"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"}