{"record":{"id":"811c5a9b6acde7f0","repo":"grafana/k6","slug":"focusing-on-q-w","errorCode":null,"errorMessage":"focusing on %q: %w","messagePattern":"focusing on %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/locator.go","lineNumber":342,"sourceCode":"\n// Filter returns a new [Locator] after applying the options to the current one.\nfunc (l *Locator) Filter(opts *LocatorFilterOptions) *Locator {\n\treturn NewLocator(l.ctx, opts.LocatorOptions, l.selector, l.frame, l.log)\n}\n\n// First will return the first child of the element matching the locator's\n// selector.\nfunc (l *Locator) First() *Locator {\n\treturn NewLocator(l.ctx, nil, l.selector+\" >> nth=0\", l.frame, l.log)\n}\n\n// Focus on the element using locator's selector with strict mode on.\nfunc (l *Locator) Focus(opts *FrameBaseOptions) error {\n\tl.log.Debugf(\"Locator:Focus\", \"fid:%s furl:%q sel:%q opts:%+v\", l.frame.ID(), l.frame.URL(), l.selector, opts)\n\n\topts.Strict = true\n\tif err := l.frame.focus(l.selector, opts); err != nil {\n\t\treturn fmt.Errorf(\"focusing on %q: %w\", l.selector, err)\n\t}\n\n\tapplySlowMo(l.ctx)\n\n\treturn nil\n}\n\n// GetAttribute of the element using locator's selector with strict mode on.\n// The second return value is true if the attribute exists, and false otherwise.\nfunc (l *Locator) GetAttribute(name string, opts *FrameBaseOptions) (string, bool, error) {\n\tl.log.Debugf(\n\t\t\"Locator:GetAttribute\", \"fid:%s furl:%q sel:%q name:%q opts:%+v\",\n\t\tl.frame.ID(), l.frame.URL(), l.selector, name, opts,\n\t)\n\n\topts.Strict = true\n\ts, ok, err := l.frame.getAttribute(l.selector, name, opts)\n\tif err != nil {","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/common/locator.go#L324-L360","documentation":"Error \"focusing on %q: %w\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/locator.go:342 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}