--- id: "738b30e0-95cc-4109-9579-1b24081169e5" name: "Context Creation UI" micro_summary: "Use Organization Settings Contexts, stable input[name=name], a native value setter plus input event, submit, then verify the context appears." status: "resolved" see_also: [] scope: "Create a missing CircleCI organization context through the authenticated Contexts UI and verify it appears. This recipe covers empty-context creation only." warnings: "Contexts are a security boundary. Confirm organization, context name, and restriction before creating one. Only empty-context creation is verified; environment-variable editing remains unproven. Never print or persist secret values." --- ## Create an Empty Context Navigate the authenticated work tab to `https://app.circleci.com/settings/organization/VCS/ORG/contexts`. Verify the organization and confirm the context does not already exist. Activate `Create context`. Generated React/Aria IDs are ephemeral; target the stable field: ```python import json context_name = 'CONTEXT_NAME' encoded_name = json.dumps(context_name) out = js(f''' (() => {{ const input = document.querySelector('input[name=name]'); if (!input) throw new Error('CircleCI context name input not found'); const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set; setter.call(input, {encoded_name}); input.dispatchEvent(new Event('input', {{bubbles: true}})); return Array.from(document.querySelectorAll('button')) .filter(button => /create context/i.test(button.textContent) && button.closest('[role=dialog], form, [class*=modal]')) .map(button => button.textContent.trim()); }})() ''') print(out) ``` After checking the intended modal button, submit it and verify the exact context name appears in the list. Verified 2026-08-14. Generic `fill_input('Name', ...)` failed despite the open modal. This evidence does not cover adding or editing context environment variables.