{"record":{"id":"6ce2861842984f5e","repo":"grafana/k6","slug":"parsing-waitforurl-options-w-6ce286","errorCode":null,"errorMessage":"parsing waitForURL options: %w","messagePattern":"parsing waitForURL options: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame_options.go","lineNumber":826,"sourceCode":"\treturn &FrameWaitForURLOptions{\n\t\tTimeout:   defaultTimeout,\n\t\tWaitUntil: LifecycleEventLoad,\n\t}\n}\n\n// Parse parses the frame waitForURL options.\nfunc (o *FrameWaitForURLOptions) Parse(ctx context.Context, opts sobek.Value) error {\n\trt := k6ext.Runtime(ctx)\n\tif !common.IsNullish(opts) {\n\t\topts := opts.ToObject(rt)\n\t\tfor _, k := range opts.Keys() {\n\t\t\tswitch k {\n\t\t\tcase \"timeout\":\n\t\t\t\to.Timeout = time.Duration(opts.Get(k).ToInteger()) * time.Millisecond\n\t\t\tcase \"waitUntil\":\n\t\t\t\tlifeCycle := opts.Get(k).String()\n\t\t\t\tif err := o.WaitUntil.UnmarshalText([]byte(lifeCycle)); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"parsing waitForURL options: %w\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":808,"sourceCodeEnd":833,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/frame_options.go#L808-L833","documentation":"Wrap of an options-parsing failure in FrameWaitForURLOptions.Parse: the options object given to frame.waitForURL() is iterated key by key, and the wrapped error fires when a value cannot be applied — most commonly an unrecognized waitUntil lifecycle value (must be one of the LifecycleEvent names like \"load\" or \"domcontentloaded\"), a non-numeric timeout, or an unsupported key.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame_options.go:826 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported waitUntil value: 'load' or 'domcontentloaded'","Pass timeout as a number in milliseconds","Spell option keys exactly as documented (timeout, waitUntil)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}