{"record":{"id":"03945e1a28dc623f","repo":"grafana/k6","slug":"unexpected-type-t-expecting-string-03945e","errorCode":null,"errorMessage":"unexpected type %T (expecting string)","messagePattern":"unexpected type %T \\(expecting string\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame.go","lineNumber":1025,"sourceCode":"\nfunc (f *Frame) getAttribute(selector, name string, opts *FrameBaseOptions) (string, bool, error) {\n\tgetAttribute := func(apiCtx context.Context, handle *ElementHandle) (any, error) {\n\t\treturn handle.getAttribute(apiCtx, name)\n\t}\n\tact := f.newAction(\n\t\tselector, DOMElementStateAttached, opts.Strict, getAttribute,\n\t\t[]string{}, false, withRetry, true, opts.Timeout,\n\t)\n\tv, err := call(f.ctx, act, opts.Timeout)\n\tif err != nil {\n\t\treturn \"\", false, errorFromDOMError(err)\n\t}\n\tif v == nil {\n\t\treturn \"\", false, nil\n\t}\n\ts, ok := v.(string)\n\tif !ok {\n\t\treturn \"\", false, fmt.Errorf(\"unexpected type %T (expecting string)\", v)\n\t}\n\n\treturn s, true, nil\n}\n\n// GetByRole creates and returns a new locator for this frame using the ARIA role\n// and any additional options.\nfunc (f *Frame) GetByRole(role string, opts *GetByRoleOptions) *Locator {\n\tf.log.Debugf(\"Frame:GetByRole\", \"fid:%s furl:%q role:%q opts:%+v\", f.ID(), f.URL(), role, opts)\n\n\treturn f.Locator(f.buildRoleSelector(role, opts), nil)\n}\n\n// isQuotedText returns true if the string is a quoted string.\n// This is used to determine if the string will be used to match\n// a string instead of as a regex in the getBy* APIs. It handles\n// both single and double quotes.\nfunc isQuotedText(s string) bool {","sourceCodeStart":1007,"sourceCodeEnd":1043,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/common/frame.go#L1007-L1043","documentation":"Error \"unexpected type %T (expecting string)\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame.go:1025 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"}