{"record":{"id":"d55aad8903fe05a8","repo":"grafana/k6","slug":"not-allowed-to-upload-result-to-k6-cloud","errorCode":null,"errorMessage":"not allowed to upload result to k6 Cloud","messagePattern":"not allowed to upload result to k6 Cloud","errorType":"http","errorClass":"ErrNotAuthorized","httpStatus":403,"severity":"error","filePath":"internal/cloudapi/httperr/httperr.go","lineNumber":17,"sourceCode":"// Package httperr contains HTTP-status-code error helpers shared by k6\n// Cloud's API clients (cloudapi, internal/cloudapi/v6). It only covers the\n// part of their CheckResponse-style functions that's genuinely identical\n// across them - classifying 401/403 - everything else about decoding an\n// error response body differs between API versions.\npackage httperr\n\nimport (\n\t\"errors\"\n\t\"net/http\"\n)\n\nvar (\n\t// ErrNotAuthenticated maps HTTP 401.\n\tErrNotAuthenticated = errors.New(\"failed to authenticate with k6 Cloud\")\n\t// ErrNotAuthorized maps HTTP 403.\n\tErrNotAuthorized = errors.New(\"not allowed to upload result to k6 Cloud\")\n)\n\n// ClassifyStatus returns ErrNotAuthenticated for HTTP 401, ErrNotAuthorized\n// for HTTP 403, and nil for any other status code.\nfunc ClassifyStatus(statusCode int) error {\n\tswitch statusCode {\n\tcase http.StatusUnauthorized:\n\t\treturn ErrNotAuthenticated\n\tcase http.StatusForbidden:\n\t\treturn ErrNotAuthorized\n\tdefault:\n\t\treturn nil\n\t}\n}\n","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/cloudapi/httperr/httperr.go#L1-L32","documentation":"Frame.IsDisabled() (frame.go:1488) wraps the isDisabled action failure as 'checking is %q disabled'. The action waits for a selector match in the attached state within Timeout and queries the element's 'disabled' state with a zero timeout (the state itself is not waited on). Wrapped errors are selector timeouts, strict-mode violations, frame/context destruction during the check, or failures of the injected state script.","triggerScenarios":"No element matches before opts.Timeout; Strict:true with multiple matches; frame navigates/detaches during the check; injected script errors on non-standard elements.","commonSituations":"Asserting buttons are disabled during in-flight requests; fields inside lazily mounted modals; using the main frame object for iframe content; broad selectors matching many nodes under strict mode.","solutions":["Wait for the element first: await page.waitForSelector(sel, { state: 'attached', timeout: 10000 }).","Narrow the selector (data-testid) to avoid strict-mode violations.","Run the check on the correct frame.","Increase timeout for slow pages: page.isDisabled(sel, { timeout: 60000 })."],"exampleFix":"// before\nconst off = await page.isDisabled('#submit');\n\n// after\nconst btn = page.locator('#submit');\nawait btn.waitFor({ state: 'attached', timeout: 10000 });\nconst off = await btn.isDisabled();","handlingStrategy":"try-catch","validationCode":"const btn = page.locator('#submit');\nawait btn.waitFor({ state: 'attached', timeout: 5000 });","typeGuard":null,"tryCatchPattern":"try {\n  return await page.isDisabled(sel, { timeout: 10000 });\n} catch (e) {\n  if (String(e).includes('timed out')) throw new Error(`element never appeared: ${sel}`);\n  throw e;\n}","preventionTips":["Wait for element attach before state checks.","Use narrow, unique selectors.","Run checks against the frame that owns the element."],"tags":["k6","browser","frame","isdisabled","selector","timeout"],"backgroundTag":"element-not-found-timeout","analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}