{"record":{"id":"139accd99c4a86a9","repo":"CloakHQ/CloakBrowser","slug":"humanized-selector-selector-is-not-supported-by-139acc","errorCode":null,"errorMessage":"Humanized selector ${selector} is not supported by the isolated-world resolver. Supported: CSS, text=, xpath=, getByTestId, getByPlaceholder, getByAltText, getByTitle, getByText, getByLabel, and a trailing .first()/.nth()/.last(). Not supported: getByRole, chained locators (a >> b, .filter(), .and(), .or()), frameLocator, :visible and :nth-match. Use a CSS or text= selector for this action, or humanize:false to fall back to Playwright.","messagePattern":"Humanized selector (.+?) is not supported by the isolated-world resolver\\. Supported: CSS, text=, xpath=, getByTestId, getByPlaceholder, getByAltText, getByTitle, getByText, getByLabel, and a trailing \\.first\\(\\)/\\.nth\\(\\)/\\.last\\(\\)\\. Not supported: getByRole, chained locators \\(a >> b, \\.filter\\(\\), \\.and\\(\\), \\.or\\(\\)\\), frameLocator, :visible and :nth-match\\. Use a CSS or text= selector for this action, or humanize:false to fall back to Playwright\\.","errorType":"exception","errorClass":"UnsupportedHumanizeSelectorError","httpStatus":null,"severity":"error","filePath":"js/src/human/index.ts","lineNumber":181,"sourceCode":"  x = 0;\n  y = 0;\n  initialized = false;\n}\n\n\n// ============================================================================\n// Canonical selector snapshot — isolated world only\n// ============================================================================\n\nasync function selectorSnapshot(\n  stealth: StealthEval | null,\n  selector: string,\n): Promise<SnapshotPayload> {\n  if (!stealth) throw new StealthWorldUnavailableError();\n  const { status, data } = await evalParsed(stealth, buildSnapshotJs(selector));\n  if (status === OK && data) return data as SnapshotPayload;\n  if (status === NOT_FOUND) throw new ElementNotAttachedError(selector);\n  if (status === UNSUPPORTED) throw new UnsupportedHumanizeSelectorError(selector);\n  throw new StealthEvaluationError(selector);\n}\n\n\n// ============================================================================\n// Page-level patching\n// ============================================================================\n\n/**\n * Replace page methods with human-like implementations.\n */\nfunction patchPage(page: Page, cfg: HumanConfig, cursor: CursorState): void {\n  const originals = {\n    click: page.click.bind(page),\n    dblclick: page.dblclick.bind(page),\n    hover: page.hover.bind(page),\n    type: page.type.bind(page),\n    fill: page.fill.bind(page),","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/CloakHQ/CloakBrowser/blob/d6bad5de261bedf025280ace1d14e800aee13923/js/src/human/index.ts#L163-L199","documentation":"The humanized (isolated-world) resolver only understands a subset of selector syntax: plain CSS, text=, xpath=, getByTestId/Placeholder/AltText/Title/Text/Label pseudo-locators, and a single trailing .first()/.nth()/.last(). When buildSnapshotJs runs the selector in the stealth world it returns an UNSUPPORTED status, and selectorSnapshot maps that to this error. It exists because the isolated-world resolver is a deliberately small JS evaluator that cannot parse Playwright's full locator engine (getByRole, chaining, filters, frameLocator, engine pseudo-selectors).","triggerScenarios":"Calling humanClear(), humanPress(), pressSequentially(), isChecked/checked, or isInput (anything routed through selectorSnapshot) with a selector like getByRole('button'), 'a >> text=Sign in', locator.filter({...}), .and()/.or(), a frameLocator-prefixed selector, ':visible', or ':nth-match'.","commonSituations":"Copy-pasting selectors from existing Playwright tests into humanized action calls; upgrading to a version where humanize:true became the default; using codegen-generated getByRole locators with the humanizer enabled.","solutions":["Replace the locator with a plain CSS selector or text= selector for this action (e.g. 'button#submit' or 'text=Sign in').","Use a supported pseudo-locator such as getByTestId('submit') or getByText('Sign in') with at most one trailing .first()/.nth(i)/.last().","Pass humanize:false (or the equivalent option) on this call to fall back to normal Playwright locator resolution.","Restructure chained locators (a >> b, .filter(), .and(), .or()) into a single more specific CSS/text selector, and resolve frame context in your own code instead of frameLocator."],"exampleFix":"// before\nawait page.getByRole('button', { name: 'Sign in' }).humanPress('Enter');\n// or: await page.locator('a >> text=Sign in').humanClick();\n\n// after\nawait humanPress(page, 'text=Sign in', 'Enter');\n// or pass humanize:false to fall back to Playwright's engine\nawait page.locator('button[name=\"signin\"]').click({ humanize: false });","handlingStrategy":"validation","validationCode":"import { isHumanizableSelector } from './human/selector';\n\nif (!isHumanizableSelector(selector)) {\n  // use a supported form or fall back to plain Playwright\n  await page.locator(selector).click();\n} else {\n  await humanClick(page, selector);\n}","typeGuard":"function isHumanizableSelector(sel: string): boolean {\n  const supported = /^(?:[a-zA-Z[#.]\\/][\\s\\S]*|text=|xpath=\\/\\/|getBy(TestId|Placeholder|AltText|Title|Text|Label)\\()/;\n  if (/getByRole|>>|\\.filter\\(|\\.and\\(|\\.or\\(|frameLocator|:visible|:nth-match/.test(sel)) return false;\n  return supported.test(sel);\n}","tryCatchPattern":"try {\n  await humanPress(page, selector, 'Enter');\n} catch (e) {\n  if (e instanceof UnsupportedHumanizeSelectorError) {\n    await page.locator(selector).press('Enter'); // humanize:false fallback\n  } else throw e;\n}","preventionTips":["Standardize on CSS or text= selectors for humanized actions in your page objects.","Lint test code for getByRole/chained locators passed into humanized helpers.","Keep a thin wrapper that catches UnsupportedHumanizeSelectorError and retries with humanize:false."],"tags":["playwright","selector","humanize","isolated-world","locator"],"backgroundTag":"unsupported-selector-syntax","analyzedSha":"d6bad5de261bedf025280ace1d14e800aee13923","analyzedAt":"2026-08-28T14:13:12.918Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}