{"record":{"id":"b6085266ce0f47cc","repo":"grafana/k6","slug":"clearing-q-w","errorCode":null,"errorMessage":"clearing %q: %w","messagePattern":"clearing %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/locator.go","lineNumber":75,"sourceCode":"}\n\n// BoundingBox will return the bounding box of the element.\nfunc (l *Locator) BoundingBox(opts *FrameBaseOptions) (*Rect, error) {\n\topts.Strict = true\n\treturn l.frame.boundingBox(l.selector, opts)\n}\n\n// Clear will clear the input field.\n// This works with the Fill API and fills the input field with an empty string.\nfunc (l *Locator) Clear(opts *FrameFillOptions) error {\n\tl.log.Debugf(\n\t\t\"Locator:Clear\", \"fid:%s furl:%q sel:%q opts:%+v\",\n\t\tl.frame.ID(), l.frame.URL(), l.selector, opts,\n\t)\n\n\topts.Strict = true\n\tif err := l.frame.fill(l.selector, \"\", opts); err != nil {\n\t\treturn fmt.Errorf(\"clearing %q: %w\", l.selector, err)\n\t}\n\n\treturn nil\n}\n\n// Timeout will return the default timeout or the one set by the user.\nfunc (l *Locator) Timeout() time.Duration {\n\treturn l.frame.defaultTimeout()\n}\n\n// Click on an element using locator's selector with strict mode on.\nfunc (l *Locator) Click(opts *FrameClickOptions) error {\n\tl.log.Debugf(\"Locator:Click\", \"fid:%s furl:%q sel:%q opts:%+v\", l.frame.ID(), l.frame.URL(), l.selector, opts)\n\t_, span := TraceAPICall(l.ctx, l.frame.page.targetID.String(), \"locator.click\")\n\tdefer span.End()\n\n\topts.Strict = true\n\topts.retry = true","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/common/locator.go#L57-L93","documentation":"Error \"clearing %q: %w\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/locator.go:75 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"}