grafana/k6 · error

parsing element double click options

Error message

parsing element double click options: %w

What it means

Wrap of an options-parsing failure for the elementHandle.dblclick() mapping: the options object passed from the script is parsed by NewElementHandleDblclickOptions (timeout, delay, button, position, modifiers, etc.), and the wrapped error indicates one of those fields had an invalid value — wrong type, out-of-range timeout, or an unknown key rejected by the parser.

Solutions

  1. Check the dblclick options object for correct field names and types (e.g., timeout as milliseconds number)
  2. Remove unsupported options not listed in the k6 browser API documentation
  3. Use plain values, not strings, for numeric options such as timeout and delay
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/js/modules/k6/browser/browser/element_handle_mapping.go:60 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@3fcf5388d7 (2026-08-18). Data as JSON: /api/errors/31f8d523775c4d1d. Report an issue: GitHub.

Appendix: source

Thrown at internal/js/modules/k6/browser/browser/element_handle_mapping.go:64

			if err != nil {
				return nil, fmt.Errorf("parsing element click options: %w", err)
			}

			return promise(vu, func() (any, error) {
				err := eh.Click(popts)
				return nil, err //nolint:wrapcheck
			}), nil
		},
		"contentFrame": func() *sobek.Promise {
			return promise(vu, func() (any, error) {
				f, err := eh.ContentFrame()
				if err != nil {
					return nil, err //nolint:wrapcheck
				}
				return mapFrame(vu, f), nil
			})
		},
		"dblclick": func(opts sobek.Value) (*sobek.Promise, error) {
			popts, err := parseElementHandleDblclickOptions(rt, opts, eh.DefaultTimeout())
			if err != nil {
				return nil, fmt.Errorf("parsing element double click options: %w", err)
			}
			return promise(vu, func() (any, error) {
				return nil, eh.Dblclick(popts) //nolint:wrapcheck
			}), nil
		},
		"dispatchEvent": func(typ string, eventInit sobek.Value) *sobek.Promise {
			return promise(vu, func() (any, error) {
				return nil, eh.DispatchEvent(typ, exportArg(eventInit)) //nolint:wrapcheck
			})
		},
		"fill": func(value string, opts sobek.Value) (*sobek.Promise, error) {
			popts := common.NewElementHandleBaseOptions(eh.DefaultTimeout())
			if err := parseElementHandleBaseOptions(popts, rt, opts); err != nil {
				return nil, fmt.Errorf("parsing element fill options: %w", err)
			}

View on GitHub (pinned to 3fcf5388d7)