{
  "doc": {
    "id": "accessibility/core-concepts/element-identification",
    "title": "Uniquely identify test elements | Cypress Accessibility",
    "description": "Elements are uniquely identified across views and snapshots by their HTML attributes, location, and other signals in the DOM.",
    "section": "accessibility",
    "source_path": "/llm/markdown/accessibility/core-concepts/element-identification.md",
    "version": "a8fd16711bdda4c7b5645b9717e588ae99ec2470",
    "updated_at": "2026-05-18T17:21:32.047Z",
    "headings": [
      {
        "id": "accessibility/core-concepts/element-identification#element-identification",
        "text": "Element Identification",
        "level": 1
      },
      {
        "id": "accessibility/core-concepts/element-identification#significant-attributes-for-identification",
        "text": "Significant attributes for identification",
        "level": 2
      },
      {
        "id": "accessibility/core-concepts/element-identification#configuring-element-identification",
        "text": "Configuring element identification",
        "level": 2
      },
      {
        "id": "accessibility/core-concepts/element-identification#attribute-filters",
        "text": "Attribute filters",
        "level": 3
      },
      {
        "id": "accessibility/core-concepts/element-identification#significant-attributes",
        "text": "Significant attributes",
        "level": 3
      },
      {
        "id": "accessibility/core-concepts/element-identification#component-attributes",
        "text": "Component attributes",
        "level": 3
      },
      {
        "id": "accessibility/core-concepts/element-identification#differences-compared-to-axe-core-element-identification",
        "text": "Differences compared to Axe-Core® element identification",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "accessibility/core-concepts/element-identification#significant-attributes-for-identification",
      "doc_id": "accessibility/core-concepts/element-identification",
      "heading": "Significant attributes for identification",
      "heading_level": 2,
      "content_markdown": "## Significant attributes for identification\n\nCertain attributes are prioritized by Cypress Accessibility for element identification. These include:\n\n*   `data-cy`\n*   `data-test`\n*   `data-testid`\n*   `data-test-id`\n*   `data-qa`\n*   `row-id`\n*   `id`\n*   `name`\n\nIf you already have Test IDs or similar attributes in your application, Cypress Accessibility will pick these up and use them to recognize the same element in a new place for improved deduplication. This behavior itself is configurable as well, so that highly-dynamic Test IDs can be avoided, for example.\n",
      "section": "accessibility",
      "anchors": [
        "significant-attributes-for-identification"
      ],
      "path": "/llm/json/chunked/accessibility/core-concepts/element-identification.json",
      "token_estimate": 111
    },
    {
      "id": "accessibility/core-concepts/element-identification#configuring-element-identification",
      "doc_id": "accessibility/core-concepts/element-identification",
      "heading": "Configuring element identification",
      "heading_level": 2,
      "content_markdown": "## Configuring element identification\n\nUsing these configuration properties helps you adjust the amount of deduplication Cypress will do to match what makes sense in your application. For example, a component-based Test ID might make a great identifier if the component renders static content, but the same exact test ID would be a poor identifier if the component renders different things everywhere - you might rather treat those instances as unique for accessibility purposes.\n\n### Attribute filters\n\nExclude irrelevant or dynamically generated attributes to reduce noise in Cypress Accessibility reports. For example, this would avoid certain IDs that are commonly generated in React applications from being used as element references in Cypress Accessibility.\n\n```\n{  \"attributeFilters\": [    {      \"attribute\": \"id\",      \"value\": \":r.*:\",      \"include\": false    }  ]}\n```\n\nElements with these IDs will still be included in your accessibility report, but they will be identified in a different way.\n\nLearn more about attribute filtering in the [Attribute Filters guide](/llm/markdown/accessibility/configuration/attributefilters.md).\n\n### Significant attributes\n\nDefine custom significant attributes to prioritize specific selectors that align with your application’s structure. For example:\n\n```\n{  \"significantAttributes\": [\"data-custom-id\"]}\n```\n\nRefer to the [Significant Attributes](/llm/markdown/accessibility/configuration/significantattributes.md) guide for detailed instructions.\n\n### Component attributes\n\nRequire extra attributes (such as a component or team identifier) in the **violation target selectors** shown in reports, to provide consistency and readability in your selectors:\n\n```\n{  \"accessibility\": {    \"components\": {      \"componentAttributes\": [        { \"attributeName\": \"data-component-name\", \"includeInSelector\": true }      ]    }  }}\n```\n\nSee the [components](/llm/markdown/accessibility/configuration/components.md) configuration guide for `componentAttributeFilters`, defaults, and examples.\n",
      "section": "accessibility",
      "anchors": [
        "configuring-element-identification"
      ],
      "path": "/llm/json/chunked/accessibility/core-concepts/element-identification.json",
      "token_estimate": 329
    },
    {
      "id": "accessibility/core-concepts/element-identification#attribute-filters",
      "doc_id": "accessibility/core-concepts/element-identification",
      "heading": "Attribute filters",
      "heading_level": 3,
      "content_markdown": "### Attribute filters\n\nExclude irrelevant or dynamically generated attributes to reduce noise in Cypress Accessibility reports. For example, this would avoid certain IDs that are commonly generated in React applications from being used as element references in Cypress Accessibility.\n\n```\n{  \"attributeFilters\": [    {      \"attribute\": \"id\",      \"value\": \":r.*:\",      \"include\": false    }  ]}\n```\n\nElements with these IDs will still be included in your accessibility report, but they will be identified in a different way.\n\nLearn more about attribute filtering in the [Attribute Filters guide](/llm/markdown/accessibility/configuration/attributefilters.md).\n",
      "section": "accessibility",
      "anchors": [
        "attribute-filters"
      ],
      "path": "/llm/json/chunked/accessibility/core-concepts/element-identification.json",
      "token_estimate": 112
    },
    {
      "id": "accessibility/core-concepts/element-identification#significant-attributes",
      "doc_id": "accessibility/core-concepts/element-identification",
      "heading": "Significant attributes",
      "heading_level": 3,
      "content_markdown": "### Significant attributes\n\nDefine custom significant attributes to prioritize specific selectors that align with your application’s structure. For example:\n\n```\n{  \"significantAttributes\": [\"data-custom-id\"]}\n```\n\nRefer to the [Significant Attributes](/llm/markdown/accessibility/configuration/significantattributes.md) guide for detailed instructions.\n",
      "section": "accessibility",
      "anchors": [
        "significant-attributes"
      ],
      "path": "/llm/json/chunked/accessibility/core-concepts/element-identification.json",
      "token_estimate": 44
    },
    {
      "id": "accessibility/core-concepts/element-identification#component-attributes",
      "doc_id": "accessibility/core-concepts/element-identification",
      "heading": "Component attributes",
      "heading_level": 3,
      "content_markdown": "### Component attributes\n\nRequire extra attributes (such as a component or team identifier) in the **violation target selectors** shown in reports, to provide consistency and readability in your selectors:\n\n```\n{  \"accessibility\": {    \"components\": {      \"componentAttributes\": [        { \"attributeName\": \"data-component-name\", \"includeInSelector\": true }      ]    }  }}\n```\n\nSee the [components](/llm/markdown/accessibility/configuration/components.md) configuration guide for `componentAttributeFilters`, defaults, and examples.\n",
      "section": "accessibility",
      "anchors": [
        "component-attributes"
      ],
      "path": "/llm/json/chunked/accessibility/core-concepts/element-identification.json",
      "token_estimate": 76
    },
    {
      "id": "accessibility/core-concepts/element-identification#differences-compared-to-axe-core-element-identification",
      "doc_id": "accessibility/core-concepts/element-identification",
      "heading": "Differences compared to Axe-Core® element identification",
      "heading_level": 2,
      "content_markdown": "## Differences compared to Axe-Core® element identification\n\nThe Cypress Cloud process replaces the underlying Axe-Core® library's default mechanism for identifying elements.\n\nAxe-Core® captures a unique identifier for a given element in a specific DOM context, focused on one single state. This default behavior does not account for merging thousands of Axe-Core® scans into a single report or for comparing scans of the application as the application changes.\n\nTaking control over how elements are tracked in your reports helps you get the right level of de-duplication across elements when they are truly the same, and track similar elements individually when they are different.\n",
      "section": "accessibility",
      "anchors": [
        "differences-compared-to-axe-core-element-identification"
      ],
      "path": "/llm/json/chunked/accessibility/core-concepts/element-identification.json",
      "token_estimate": 136
    }
  ]
}