## TL;DR
Fix the login flow before the dashboard flow: reproduce the sign-in manually in the same browser profile, confirm whether the dashboard uses redirect-based single sign-on or an embedded login form, and make the script wait for the post-login dashboard selector rather than a fixed URL. Most agent login failures are redirect timing or a session that starts at an identity provider page the script never handles.

```text
playwright failed to open data quality dashboard error agent failed login
```

## Use this when
- The check or run fails with this symptom: Playwright fails to open the data quality dashboard at the login step.
- You are working on an agent opening a data quality dashboard such as Monte Carlo, Soda Cloud, or a Grafana panel and the failure repeats on the same data or configuration.
- You need the failing rows, rule, or stage isolated before changing thresholds or code.

## Not for this skill when
- A dashboard that is genuinely down or returning server errors, where the fix is waiting for the service rather than repairing the login script.
- The error text names a different tool, stage, or root cause. Match the verbatim error first and use that skill.

## Steps
1. Open the dashboard URL in a persistent browser profile and complete sign-in once interactively so cookies and provider redirects are stored. Verify: the dashboard loads signed-in inside that profile
2. Point the script at the saved profile and wait for a dashboard-specific selector, such as the workspace name or nav element, with a generous timeout. Verify: the script reaches the signed-in dashboard view
3. Log the final URL and page title on failure so identity-provider redirects are visible in the run output. Verify: a failed run shows where the browser actually landed
4. If the provider uses device or MFA prompts, switch the flow to a stored session or an API key based dashboard session instead of automating the prompt. Verify: the script no longer depends on an interactive challenge

## Variant phrasings
### playwright data quality dashboard login failed agent
The login-failure phrasing.
### agent cannot sign in to monitoring dashboard sso
The single sign-on phrasing.
### browser automation stuck at identity provider redirect dashboard
The redirect phrasing.

Compatibility: Playwright browser automation against data quality dashboards with single sign-on

## Why it happens
Dashboards sit behind identity providers that redirect through several pages, set cookies, and sometimes challenge new browsers. A script written against the final dashboard page fails at the first redirect because its waits and selectors describe a page the browser has not reached yet.

## Edge cases / pitfalls
- Sessions expire; detect the login page during later steps and re-authenticate once instead of failing the whole run.
- Headless browsers are challenged more often; a headed persistent profile is the reliable default for dashboards.

## Provenance

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