Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The error occurs because Playwright reads data-qa=save as a selector-engine prefix named data-qa. Playwright’s documented shorthand prefixes include id=, data-testid=, data-test-id=, and data-test=, but not data-qa=. Query the attribute with CSS instead:

await page.locator('[data-qa="save"]').click();

If data-qa is your project’s standard test identifier, configure Playwright to use it and keep the cleaner getByTestId() API. The sections below show both fixes, explain why the parser reports an unknown engine, and give a troubleshooting path for cases where the error continues.

Why Playwright calls data-qa an unknown engine

Playwright selectors can name a selector engine with the form engine=body. A bare selector beginning with data-qa= therefore looks like a request to use an engine named data-qa. Unless your test suite registered an engine with that exact name, Playwright cannot resolve it and reports an unknown engine.

The data-qa attribute itself is valid HTML. The problem is only the selector syntax. CSS attribute selectors put the attribute in brackets, so the parser treats it as CSS rather than an engine prefix.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Fix the selector directly with CSS

Use the attribute-value form

Replace the shorthand with a CSS attribute selector. This works with page.locator() and other Playwright APIs that accept selectors:

import { test, expect } from '@playwright/test';

test('saves the form', async ({ page }) => {
  await page.goto('https://example.test/settings');
  await page.locator('[data-qa="save"]').click();
  await expect(page.locator('[data-qa="success-message"]')).toBeVisible();
});

Playwright auto-detects CSS when the selector does not specify an explicit engine. If you want to make that choice unmistakable, add the css= prefix:

await page.locator('css=[data-qa="save"]').click();

Both forms select an element whose rendered DOM contains data-qa="save". Keep the value in quotes when it contains spaces, punctuation, or characters that could be interpreted as CSS syntax.

Check the rendered attribute and value

The selector must match the DOM Playwright actually sees. A test that expects save will not match data-qa="save-button", an element where the attribute is added only after a different action, or markup rendered inside a different page context. Inspect the element in the browser and compare the attribute name and value character for character.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure data-qa as Playwright’s test-id attribute

Project-wide configuration

When data-qa is the established test contract for your application, set it once in playwright.config.ts:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  use: {
    testIdAttribute: 'data-qa',
  },
});

After this change, getByTestId('save') searches for data-qa="save" instead of the default data-testid attribute:

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
import { test, expect } from '@playwright/test';

test('saves with the configured test id', async ({ page }) => {
  await page.goto('https://example.test/settings');
  await page.getByTestId('save').click();
  await expect(page.getByTestId('success-message')).toBeVisible();
});

This changes how Playwright’s test-id locator resolves values; it does not rename attributes in your application source.

Set the attribute through the API

If changing the shared configuration is not appropriate, set the attribute before creating pages and then use getByTestId():

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { chromium, selectors } from 'playwright';

selectors.setTestIdAttribute('data-qa');

const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.test/settings');
await page.getByTestId('save').click();
await browser.close();

Use this approach consistently in the process. Calling it after pages have already been created can leave earlier code using a different selector configuration.

Choose the locator that best represents the element

Fixing the parser error does not automatically make a locator a good long-term choice. Select the strategy that expresses why the test is locating the element:

Locator Example Best fit Trade-off
Role and accessible name page.getByRole('button', { name: 'Save' }) The control has a meaningful user-facing role and name. It depends on accessible naming and can change when visible copy changes.
Label page.getByLabel('Project name') A form control is associated with a visible label. It is not suitable for controls without a label.
Configured test id page.getByTestId('save') data-qa is an intentional, stable test contract. It is an implementation-level hook rather than user-facing behavior.
CSS attribute page.locator('[data-qa="save"]') You need a direct query without changing global configuration. The selector is tied to the attribute name and value.

Prefer a role or label when it identifies the control clearly. Use the configured test-id API when the team deliberately maintains data-qa values for automation. Use the CSS form for a one-off query or when you cannot change the project’s configuration.

When a custom selector engine is actually appropriate

A custom engine is separate from ordinary attribute matching. Register one only when it provides behavior that CSS or test-id locators cannot provide. Registration must happen before the page is created, and the name used in the selector must exactly match the registered prefix.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

For a normal element such as <button data-qa="save">Save</button>, registering an engine is unnecessary. The CSS selector [data-qa="save"] or a configured getByTestId('save') is simpler and avoids another global extension.

Systematic troubleshooting when the error persists

1. Print the exact selector string

Inspect the value passed to locator(), click(), or a helper that wraps those calls. A template, concatenation, or page-object method may still be producing data-qa=... even after one call site was changed.

const selector = `[data-qa="${id}"]`;
console.log('selector:', selector);
await page.locator(selector).click();

2. Search helpers and chained selectors

A helper may prepend or rewrite a selector. Check page objects, fixture utilities, selector constants, and any code that combines a parent locator with a child string. Confirm that the final value still contains brackets around data-qa.

3. Verify the target is in the current DOM

Use the browser inspector or Playwright’s locator count to check whether the expected attribute exists at the time of the query:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const saveButton = page.locator('[data-qa="save"]');
console.log('matches:', await saveButton.count());

A count of zero indicates a DOM, timing, value, or page-context problem rather than an unknown-engine problem. Check that the page navigation completed, the expected state was reached, and the attribute value is correct.

4. Confirm the configured test-id attribute

If you changed testIdAttribute, make sure the test is running with the configuration file you edited. Monorepos and separate test projects can load different configuration files. Also check that the application uses data-qa consistently rather than mixing it with data-testid.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

5. Check custom-engine initialization

If the selector was intentionally written as an engine prefix, verify that selectors.register() runs before any page or browser context is created and that the registered name is identical to the prefix in the selector. If no custom behavior is needed, remove the engine syntax and use CSS instead.

6. Pause and inspect interactively

Playwright supports pausing a test with page.pause(). Run the test with PWDEBUG=console when you need to inspect selectors interactively in the browser developer-tools console:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.pause();

Use the paused browser to verify the element, its attributes, and the selector that matches it. Remove the pause after diagnosing the problem.

Common selector mistakes and their corrections

  • Wrong: page.locator('data-qa=save')
    Correct: page.locator('[data-qa="save"]')
  • Wrong: page.getByTestId('data-qa=save')
    Correct: configure testIdAttribute: 'data-qa', then call page.getByTestId('save').
  • Wrong: assuming a test id is present because it exists in a component template
    Correct: inspect the rendered DOM; server-side conditions or a different component state may omit it.
  • Wrong: registering an engine after creating the page
    Correct: register the engine during startup, before page creation, or use a CSS attribute selector.

Language and version considerations

The examples use Playwright’s JavaScript/TypeScript API. Other Playwright language bindings expose equivalent locator concepts, but configuration file names and method syntax differ. Apply the same rule in every binding: a bare data-qa=... string is not the documented shorthand for this attribute; use CSS brackets or configure the binding’s test-id attribute. Check the API version used by your project before copying configuration code into a different language.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and maintenance

For a single element, the practical difference between a CSS attribute locator and a configured test-id locator is usually less important than whether the locator remains unique and stable. Reliability improves when the attribute value is deliberately maintained as part of the test contract, rather than generated from presentation text or a changing database identifier.

Keep locator construction in one place when values are dynamic. Escape or quote values correctly, and avoid building a selector from untrusted text. If a control has a stable accessible name, a role locator can test the behavior users perceive and reduce coupling to markup. If the team needs implementation-stable hooks across redesigns, standardize data-qa values and use getByTestId() after configuring the attribute.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Or skip the browser setup

If your goal is a static image or PDF of a page rather than an interactive Playwright assertion, ScreenshotNeo provides a single HTTP request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response reports the result in X-Page-Verdict and X-Billed headers.

Use the API documentation at https://screenshotneo.com/docs/ for the complete option set, including full-page screenshots with lazy images loaded, CSS-selector element capture, dark mode, device presets, arbitrary viewports, retina scale, PDF paper sizes and page ranges, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, cache TTLs, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, usage data, and the OpenAPI specification.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://stripe.com'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

ScreenshotNeo also has an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. Every feature is available on every plan, and yearly billing provides two months free. Create a free ScreenshotNeo account to try it.

Final diagnosis

Change data-qa=save to [data-qa="save"] for an immediate, local fix. If data-qa is your team’s standard test identifier, set testIdAttribute: 'data-qa' and use getByTestId('save'). Only register a selector engine when you need custom behavior; ordinary data-qa attributes do not require one.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Will changing testIdAttribute modify my application’s HTML?

No. It only tells Playwright which attribute getByTestId() should query; your application markup remains unchanged.

Can one test suite use both data-testid and data-qa?

A single configured getByTestId() lookup uses the attribute selected in that configuration. For an element using the other attribute, query it directly with a CSS selector such as [data-testid="value"].

Is ScreenshotNeo a replacement for an interactive Playwright test?

No. ScreenshotNeo captures rendered pages or PDFs through an API. Use Playwright when you need browser interactions, assertions, or end-to-end workflows.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.