Using Claude Code, Cursor, or another coding agent? Paste this into your prompt to run cross-browser and real-device tests, debug sessions, and wire up CI on the TestMu AI cloud:
Log Locations
Before diagnosing, know where to look:
The
run_end event in Agent Mode provides session_dir and run_dir directly.
Chrome Issues
”Chrome failed to launch”
Cause: Chrome is not installed, all CDP ports in the 9222–9230 range are in use, or a profile lock from another running Chrome. Kane CLI manages a Chrome process and connects to it over the Chrome DevTools Protocol (CDP). On macOS it looks under/Applications/Google Chrome.app; on Linux it looks for google-chrome, google-chrome-stable, chromium, and similar binaries; on Windows it looks under Program Files\Google\Chrome\Application\chrome.exe and AppData\Local.
Fix:
- Install Google Chrome if not present
- Check for processes on CDP ports:
- Quit any extra Chrome processes hoarding the 9222–9230 port range
- Pick a different Chrome user-data directory, or quit the Chrome instance using it. See Chrome Management
- If you only need to connect to an already-running Chrome:
“CDP endpoint not reachable”
Cause: Using--cdp-endpoint but Chrome is not running on that port.
Fix: Remove --cdp-endpoint and let Kane CLI manage Chrome automatically. Or start Chrome with remote debugging before running:
Chrome opens then closes immediately
Cause: Another Kane CLI instance is already running and holds the Chrome profile lock. Fix: Check for running kane-cli processes:Authentication Issues
”Authentication failed” (exit code 2)
Cause: Expired tokens or incorrect credentials. Fix for interactive use:- Re-run the login flow:
- Confirm which profile, environment, and token state are active:
If the token is missing or expired and refresh did not succeed, log in again.
”Not configured” on first run
Cause: No profile exists yet. Fix: Run the login flow:Basic auth not working
Cause: Wrong username or access key. Fix: Verify your credentials on the dashboard. Username and access key are case-sensitive. Make sure you’re using the access key (not the password).Run Issues
”Run timed out” or “max steps exceeded”
Cause: Objective is too complex, page is slow to load, or--max-steps is too low.
Fix:
- Increase
--timeout:--timeout 300 - Increase
--max-steps:--max-steps 60 - Break the work into smaller objectives. Run several sequential
kane-cli runinvocations, each focused on one logical sub-task. The session keeps the same browser between runs, so state carries over. - Tighten the objective. Vague objectives often cause the agent to wander; describe the target outcome and any required values up front.
Agent repeats the same action
Cause: The agent is stuck in a loop: the page didn’t change after the action. Fix: Rephrase the objective to be more explicit. Add an assertion after the action to confirm state changed:“Variables not resolving”: {{key}} appears literally
Cause: Variable file not loaded, wrong JSON format, or wrong variable key name.
Fix:
- JSON syntax. Variable files are JSON. A missing comma or unquoted key will cause the file to be skipped silently.
- File location. Confirm your file is in the right place — see loading order.
- Inline test. Bypass file loading by passing the variable on the command line:
If the inline form works, the issue is with file loading, not the variable itself.
Assertions fail even though the page looks correct
Cause: The assertion phrasing doesn’t match what’s on the page, or there’s a timing issue. Fix:- Check the screenshot at
{run_dir}/run-test/screenshots/step_NNN.png: see exactly what the agent saw - Refine the assertion: use
assert the page contains(substring) instead of exact text - Add a wait:
"wait for the confirmation message to appear, then assert..."
Upload Issues
”Upload failed” or “Test Manager error”
Cause: Kane CLI uploads run artifacts to Test Manager at the end of the session. If the upload fails: Fix:- Authentication. Re-check
kane-cli whoamiand re-login if needed. Test Manager upload requires a valid token (or basic auth) for the configured environment. - Network connectivity. The upload talks to the control plane and a cloud storage endpoint. Verify outbound HTTPS is not blocked by a proxy or firewall.
- Project is set. The pipeline will not commit a test case without a project. Confirm one is configured:
If
project_idis empty, set it withkane-cli config projector pick one in the TUI.
Agent Mode Issues
No NDJSON output / only seeing TUI
Cause: Missing--agent flag.
Fix: Add --agent to your command:
NDJSON parsing fails: jq errors or unexpected output
Cause: Stderr is mixing with stdout, or you’re trying to parse mid-stream events.
Fix: Redirect stderr and use tail -1 to get only the run_end event:
ask_user event fires and blocks the run
Cause: The objective requires human input in an agent context.
Fix: Rewrite the objective to avoid prompts. For example, instead of “navigate through the sign-up flow”, be explicit:
Installation Issues
kane-cli: command not found after install
Cause: npm global bin directory is not in your PATH.
Fix:
Installation fails
Cause: Node.js version is below 18. Fix: Check your version and upgrade:Install fails with “sharp: Please add node-addon-api”
Symptom:npm install -g @testmuai/kane-cli fails with sharp: Please add node-addon-api to your dependencies (any Node version, any platform).
Kane CLI 0.3.4+ treats
sharp as an optional dependency, so the install still succeeds even if sharp fails. Screenshots simply upload as PNG instead of WebP (about 30% larger, no functional impact). On an older version, upgrade first with npm install -g @testmuai/kane-cli@latest.sharp powers optional PNG to WebP screenshot compression. When it cannot load its prebuilt binary it tries to build from source, which fails. The most common trigger on macOS is a system-wide libvips (often pulled in by brew install appium, imagemagick, or gdal).
Fix (most common, macOS):
npm config get omit should not contain optional, so clear it with npm config delete omit and reinstall), and a proxy or private registry that does not forward the @img scope (add an @img:registry=https://registry.npmjs.org/ pass-through). If you are fine with PNG screenshots, no action is needed.
Mobile Issues
Mobile testing is supported on macOS Apple Silicon (arm64) only. Start every mobile problem withdoctor, which prints one line per required check, each with a fix:
”Update available” Notice
Kane CLI checks the public npm registry for a newer release once every 24 hours. The result is cached locally so the check itself is non-blocking and silent on failure. When a newer version exists, Kane CLI surfaces an “update available” notification with the current and latest versions and a severity label (major, minor, or patch).
The notice is informational — your current version still works. To upgrade, follow the steps in Updates.
Filing a Bug Report
If you encounter behavior that looks like an agent bug (not auth, timeout, or a vague objective), file an issue: github.com/LambdaTest/kane-cli/issues Include the following:
Do NOT file bug reports for: auth issues, low timeouts, vague objectives, or site-side errors (CAPTCHAs, 500 errors).