{"record":{"id":"17b9b8efabaaaa3b","repo":"grafana/k6","slug":"parsing-locator-press-sequentially-options-w","errorCode":null,"errorMessage":"parsing locator press sequentially options: %w","messagePattern":"parsing locator press sequentially options: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/browser/locator_mapping.go","lineNumber":382,"sourceCode":"\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn lo.SelectOption(convValues, copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"press\": func(key string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFramePressOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing press options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, lo.Press(key, copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\n\t\t\"pressSequentially\": func(text string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFrameTypeOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing locator press sequentially options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, lo.PressSequentially(text, copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\n\t\t\"type\": func(text string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFrameTypeOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing type options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, lo.Type(text, copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"hover\": func(opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFrameHoverOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/browser/locator_mapping.go#L364-L400","documentation":"Thrown synchronously when the options argument to locator.pressSequentially(text, opts) fails to parse. The mapping (locator_mapping.go:379-383) builds common.FrameTypeOptions and wraps Parse failures as \"parsing locator press sequentially options: %w\". Parse (via ElementHandleTypeOptions, element_handle_options.go:542-558) reads delay, noWaitAfter and timeout via coercing accessors that tolerate ordinary type mistakes, so the wrapped error comes from sobek raising during property access on the options object — a throwing getter, Proxy trap, or throwing implicit numeric conversion.","triggerScenarios":"A getter on delay/timeout that raises; a Proxy around options with throwing get/ownKeys traps; a delay value whose valueOf/Symbol.toPrimitive throws during ToInteger.","commonSituations":"Typing-simulation helpers that pull delay from accessor-based config; argument-tracing Proxies; ported Playwright type() code paths reused for pressSequentially with decorated option objects.","solutions":["Pass a plain literal: locator.pressSequentially('hello', { delay: 50, timeout: 5000 })","Precompute dynamic option values; avoid accessors and Proxies","Keep to recognized keys (delay ms, noWaitAfter boolean, timeout ms, strict boolean)","try/catch the call to surface a clean error"],"exampleFix":"// before\nawait locator.pressSequentially(code, optsProxy); // Proxy throws in get\n\n// after\nconst { delay, timeout } = optsProxy;\nawait locator.pressSequentially(code, { delay, timeout });","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isPlainTypeOptions(o) {\n  return o == null || (typeof o === 'object' &&\n    (o.delay === undefined || Number.isFinite(o.delay)) &&\n    (o.noWaitAfter === undefined || typeof o.noWaitAfter === 'boolean') &&\n    (o.timeout === undefined || Number.isFinite(o.timeout)));\n}","tryCatchPattern":"try {\n  await locator.pressSequentially(text, opts);\n} catch (e) {\n  throw new Error(`pressSequentially failed (check delay/timeout are plain numbers): ${e}`);\n}","preventionTips":["Use a plain literal: { delay: 50, timeout: 5000 }","Resolve typing-delay config before the call","Never hand accessor-decorated objects to browser APIs"],"tags":["k6","browser","locator","presssequentially","options"],"backgroundTag":"invalid-options-object","analyzedSha":"8d06114777191d21ef885d05c5f8aa9e1ed838ae","analyzedAt":"2026-09-14T20:10:14.619Z","contentChangedAt":"2026-09-14T20:10:14.619Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}