Official automation examples
The incogniton-automation-examples repository is the official starter for automating Incogniton with the Node.js and Python SDKs. Every example launches a real profile, verifies a result, writes artifacts and stops the profile cleanly.
Requirements: the Incogniton desktop app on Windows or macOS, running and logged in, a plan that includes automation, the API enabled under Settings → Automation (default 127.0.0.1:35000), and a dedicated test profile.
Quickstart
git clone https://github.com/WorkingGreen/incogniton-automation-examples.git
cd incogniton-automation-examples
npm ci
npm run setup -- --non-interactive --profile-id <your-test-profile-id>
npm run doctor
npm run example:screenshot
Find an example by task
| Task | Example |
|---|---|
| How do I automate Incogniton with Playwright? | launch-profile-and-screenshot |
| How do I automate Incogniton with Puppeteer? | puppeteer-launch-profile-and-screenshot |
| How do I preserve cookies and localStorage between runs? | reuse-profile-session |
| How do I fill and submit forms? | click-and-fill-form |
| How do I automate an iframe? | interact-with-iframe |
| How do I automate a canvas game? | control-canvas-game |
| How do I run multiple profiles concurrently? | run-multiple-profiles |
| How do I connect to an already running profile? | attach-to-running-profile |
| How do I create and delete a profile from code? | create-and-clean-up-profile |
| How do I take screenshots with the Python SDK? | python-playwright-launch-profile-and-screenshot |
| How do I use Selenium with Incogniton? | python-selenium-launch-profile-and-screenshot |
Rules that make automation reliable
- Check the status first. Launch only when
client.profile.getStatus(id)returnsReady. Launching a profile that is already open fails. - Check the response envelope. Launch errors are returned as
{"status":"error","message":...}with HTTP 200. - Use the persistent context. In Playwright, use
browser.contexts()[0].browser.newPage()andbrowser.newContext()create an empty context without the profile's cookies and storage. - Stop gracefully. Close your tab, then send CDP
Browser.closeand wait for the statusReady.client.profile.stop(id)terminates the browser process, so cookies and localStorage written just before can be lost. - No fixed sleeps. Poll the DevTools endpoint (
<puppeteerUrl>/json/version) with a deadline instead of waiting a fixed time.
Details: Lifecycle and persistence · Troubleshooting and exit codes