{"record":{"id":"cc1e691676e6c26f","repo":"grafana/k6","slug":"parsing-element-input-value-options-w","errorCode":null,"errorMessage":"parsing element input value options: %w","messagePattern":"parsing element input value options: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/browser/element_handle_mapping.go","lineNumber":119,"sourceCode":"\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, eh.Hover(popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"innerHTML\": func() *sobek.Promise {\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn eh.InnerHTML() //nolint:wrapcheck\n\t\t\t})\n\t\t},\n\t\t\"innerText\": func() *sobek.Promise {\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn eh.InnerText() //nolint:wrapcheck\n\t\t\t})\n\t\t},\n\t\t\"inputValue\": func(opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts := common.NewElementHandleBaseOptions(eh.DefaultTimeout())\n\t\t\tif err := popts.Parse(vu.Context(), opts); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing element input value options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn eh.InputValue(popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isChecked\": func() *sobek.Promise {\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn eh.IsChecked() //nolint:wrapcheck\n\t\t\t})\n\t\t},\n\t\t\"isDisabled\": func() *sobek.Promise {\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn eh.IsDisabled() //nolint:wrapcheck\n\t\t\t})\n\t\t},\n\t\t\"isEditable\": func() *sobek.Promise {\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn eh.IsEditable() //nolint:wrapcheck","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/browser/element_handle_mapping.go#L101-L137","documentation":"Thrown synchronously by ElementHandle.inputValue() when its options fail to parse. inputValue() parses common.ElementHandleBaseOptions (force, noWaitAfter, timeout), whose Parse in common/element_handle_options.go is all lenient coercion and always returns nil, so this wrap is defensive and effectively unreachable in current k6. Seeing it usually means an older xk6-browser Parse implementation or a regression.","triggerScenarios":"In current code none: force/noWaitAfter/timeout coerce any JS value and unknown keys are ignored. Older builds could fail when the whole options object could not be exported onto the struct.","commonSituations":"Scripts written for old xk6-browser releases; passing a timeout in seconds or as '30s' (silently coerced to a wrong duration rather than erroring); confusing this parse error with the later inside-promise error 'node is not an <input> element'.","solutions":["Use only { force, noWaitAfter, timeout } with a millisecond number for timeout","Confirm the element is an input/textarea/select before calling inputValue","Upgrade k6 to a current version where base Parse cannot fail, then re-test","Read the wrapped cause after the colon to identify the failing field in your build"],"exampleFix":"// before\nconst v = await el.inputValue({ timeout: '30s' });\n\n// after\nconst v = await el.inputValue({ timeout: 30000 });","handlingStrategy":"try-catch","validationCode":"if (opts?.timeout !== undefined && !Number.isFinite(Number(opts.timeout))) {\n  throw new Error('inputValue(): timeout must be a number of milliseconds');\n}\nconst tag = await el.getProperty('tagName').then(r => r.jsonValue());\nif (!/INPUT|TEXTAREA|SELECT/.test(String(tag))) {\n  throw new Error(`inputValue(): ${tag} is not an input element`);\n}","typeGuard":"function isInputValueOpts(o) {\n  if (o == null) return true;\n  return (o.force === undefined || typeof o.force === 'boolean') &&\n         (o.noWaitAfter === undefined || typeof o.noWaitAfter === 'boolean') &&\n         (o.timeout === undefined || Number.isFinite(o.timeout));\n}","tryCatchPattern":"try {\n  const v = await el.inputValue(opts);\n} catch (e) {\n  if (/parsing element input value options/.test(String(e.message))) {\n    console.log(`fix inputValue options: ${e.message}`);\n  } else throw e; // e.g. 'node is not an <input> element' happens inside the promise\n}","preventionTips":["Check the element tag before inputValue(); the common real error is not a parse error","Keep timeout numeric in milliseconds","Seeing this message on modern k6 indicates a regression: capture the wrapped cause and k6 version"],"tags":["k6","browser","element-handle","input-value","option-parsing"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}