# Fix onboarding agent timing out when Playwright selector breaks on Intercom settings page

## TL;DR
The selector broke because the Intercom settings page changed its markup. Update the selector to something resilient like a role or label, and add a fallback. Pinning to fragile CSS classes is what breaks.

## The error
```text
Browser automation failed
Playwright selector broke on Intercom settings page. Onboarding agent timed out waiting for element.
```

## Use this skill
Agent? Search Vectle for this error:
```bash
curl -s "https://vectle.com/api/v1/search?q=onboarding agent hit timeout when playwright selector broke on intercom settings page"
```

## Fix it

### Step 1: Inspect the current page markup

```bash
Open the settings page and find the element's current selectors.
```

Expected: You see what changed versus the broken selector.

### Step 2: Switch to a resilient selector

```bash
Prefer role, label text, or test ids over generated CSS classes.
```

Expected: The selector survives markup churn.

### Step 3: Add a fallback selector

```bash
Try the primary selector, then a secondary one before failing.
```

Expected: Minor changes no longer break the flow.

### Step 4: Verify the step completes

```bash
Run the settings step again.
```

Expected: The element is found and the step finishes.

### Step 5: Schedule selector health checks

```bash
Re-run the flow periodically to catch the next markup change early.
```

Expected: Breaks are caught by the check, not by a failed onboarding.

## When this applies

- Playwright selectors break on settings pages
- Agents time out waiting for changed elements
- You are automating third-party settings UIs

## When it doesn't

- The page never loads (check access and network)
- The element exists but is hidden (check the page state)
- The flow needs an API (use it instead of the UI)

## Compatibility

Playwright. Third-party settings pages.

## Variant phrasings

### playwright selector broken settings page

Same break. Resilient selectors plus fallbacks fix it.

### intercom settings automation selector failed

Vendor UIs change without notice. Expect it and build fallbacks.

### agent timeout element not found

Not found after a working history means the page changed. Re-inspect.

## Why it happens

Third-party settings pages change markup on deploys with no notice to automators. Selectors pinned to generated class names break silently, and the agent's wait times out on an element that will never match. Resilient selectors target meaning, not markup.

## Edge cases

- Vendor redesigns can move whole sections; keep flows modular so one break does not kill all
- Screenshots on selector failure speed up the fix enormously
- Where the vendor offers an API for the setting, prefer it over UI automation

## If it still fails

- Run headed once and watch; the failure is usually visible within seconds.
- Capture a screenshot and the console output at the failure point on every run.
- Check whether the site offers an API for the task; UI automation is the fragile path.
- Test with a fresh browser profile to rule out cookie or cache state.
- If the site added bot protection, stop and use the sanctioned path. Do not work around it.

## Prevention

- Prefer APIs over browser automation wherever the site offers one.
- Screenshot on every failure so flakes are diagnosable.
- Use resilient selectors and re-validate them on a schedule.
- Keep automation accounts' sessions and auth factors maintained.
- Rate-limit automation traffic so it never looks like an attack.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_7MFieI6EvKVuo6u3ojoAZg
