{
  "doc": {
    "id": "api/commands/nextall",
    "title": "cy.nextAll()",
    "description": "Get all following siblings of each DOM element in a set of matched DOM elements in Cypress.",
    "section": "api",
    "source_path": "/llm/markdown/api/commands/nextall.md",
    "version": "29f95bf8bb06f320986f3749f5bf09a35a409eab",
    "updated_at": "2026-09-04T10:49:54.630Z",
    "headings": [
      {
        "id": "api/commands/nextall#nextall",
        "text": "nextAll",
        "level": 1
      },
      {
        "id": "api/commands/nextall#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/commands/nextall#usage",
        "text": "Usage",
        "level": 3
      },
      {
        "id": "api/commands/nextall#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/commands/nextall#yields",
        "text": "Yields",
        "level": 3
      },
      {
        "id": "api/commands/nextall#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/commands/nextall#no-args",
        "text": "No Args",
        "level": 3
      },
      {
        "id": "api/commands/nextall#find-all-of-the-elements-siblings-following-second",
        "text": "Find all of the element's siblings following .second",
        "level": 4
      },
      {
        "id": "api/commands/nextall#selector",
        "text": "Selector",
        "level": 3
      },
      {
        "id": "api/commands/nextall#find-all-of-the-following-siblings-of-each-li-keep-only-the-ones-with-a-class-selected",
        "text": "Find all of the following siblings of each li. Keep only the ones with a class selected",
        "level": 4
      },
      {
        "id": "api/commands/nextall#rules",
        "text": "Rules",
        "level": 2
      },
      {
        "id": "api/commands/nextall#requirements",
        "text": "Requirements",
        "level": 3
      },
      {
        "id": "api/commands/nextall#assertions",
        "text": "Assertions",
        "level": 3
      },
      {
        "id": "api/commands/nextall#timeouts",
        "text": "Timeouts",
        "level": 3
      },
      {
        "id": "api/commands/nextall#command-log",
        "text": "Command Log",
        "level": 2
      },
      {
        "id": "api/commands/nextall#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/commands/nextall#syntax",
      "doc_id": "api/commands/nextall",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\n.nextAll()\n.nextAll(selector)\n.nextAll(options)\n.nextAll(selector, options)\n```\n\n### Usage\n\n**Correct Usage**\n\n```\ncy.get('.active').nextAll() // Yield all links next to `.active`\n```\n\n**Incorrect Usage**\n\n```\ncy.nextAll() // Errors, cannot be chained off 'cy'\ncy.getCookies().nextAll() // Errors, 'getCookies' does not yield DOM element\n```\n\n### Arguments\n\n**selector _(String selector)_**\n\nA selector used to filter matching DOM elements.\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.nextAll()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.nextAll()` to resolve before [timing out](#Timeouts) |\n\n### Yields\n\n*   `.nextAll()` yields the new DOM element(s) it found.\n*   `.nextAll()` is a query, and it is _safe_ to chain further commands.\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/commands/nextall.json",
      "token_estimate": 184
    },
    {
      "id": "api/commands/nextall#usage",
      "doc_id": "api/commands/nextall",
      "heading": "Usage",
      "heading_level": 3,
      "content_markdown": "### Usage\n\n**Correct Usage**\n\n```\ncy.get('.active').nextAll() // Yield all links next to `.active`\n```\n\n**Incorrect Usage**\n\n```\ncy.nextAll() // Errors, cannot be chained off 'cy'\ncy.getCookies().nextAll() // Errors, 'getCookies' does not yield DOM element\n```\n",
      "section": "api",
      "anchors": [
        "usage"
      ],
      "path": "/llm/json/chunked/api/commands/nextall.json",
      "token_estimate": 47
    },
    {
      "id": "api/commands/nextall#arguments",
      "doc_id": "api/commands/nextall",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**selector _(String selector)_**\n\nA selector used to filter matching DOM elements.\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.nextAll()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.nextAll()` to resolve before [timing out](#Timeouts) |\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/commands/nextall.json",
      "token_estimate": 93
    },
    {
      "id": "api/commands/nextall#examples",
      "doc_id": "api/commands/nextall",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n### No Args\n\n#### Find all of the element's siblings following `.second`\n\n```\n<ul>\n  <li>apples</li>\n  <li class=\"second\">oranges</li>\n  <li>bananas</li>\n  <li>pineapples</li>\n  <li>grapes</li>\n</ul>\n```\n\n```\n// yields [<li>bananas</li>, <li>pineapples</li>, <li>grapes</li>]\ncy.get('.second').nextAll()\n```\n\n### Selector\n\n#### Find all of the following siblings of each li. Keep only the ones with a class `selected`\n\n```\n<ul>\n  <li>apples</li>\n  <li>oranges</li>\n  <li>bananas</li>\n  <li class=\"selected\">pineapples</li>\n  <li>grapes</li>\n</ul>\n```\n\n```\n// yields <li>pineapples</li>\ncy.get('li').nextAll('.selected')\n```\n",
      "section": "api",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/api/commands/nextall.json",
      "token_estimate": 91
    },
    {
      "id": "api/commands/nextall#no-args",
      "doc_id": "api/commands/nextall",
      "heading": "No Args",
      "heading_level": 3,
      "content_markdown": "### No Args\n\n#### Find all of the element's siblings following `.second`\n\n```\n<ul>\n  <li>apples</li>\n  <li class=\"second\">oranges</li>\n  <li>bananas</li>\n  <li>pineapples</li>\n  <li>grapes</li>\n</ul>\n```\n\n```\n// yields [<li>bananas</li>, <li>pineapples</li>, <li>grapes</li>]\ncy.get('.second').nextAll()\n```\n",
      "section": "api",
      "anchors": [
        "no-args"
      ],
      "path": "/llm/json/chunked/api/commands/nextall.json",
      "token_estimate": 40
    },
    {
      "id": "api/commands/nextall#selector",
      "doc_id": "api/commands/nextall",
      "heading": "Selector",
      "heading_level": 3,
      "content_markdown": "### Selector\n\n#### Find all of the following siblings of each li. Keep only the ones with a class `selected`\n\n```\n<ul>\n  <li>apples</li>\n  <li>oranges</li>\n  <li>bananas</li>\n  <li class=\"selected\">pineapples</li>\n  <li>grapes</li>\n</ul>\n```\n\n```\n// yields <li>pineapples</li>\ncy.get('li').nextAll('.selected')\n```\n",
      "section": "api",
      "anchors": [
        "selector"
      ],
      "path": "/llm/json/chunked/api/commands/nextall.json",
      "token_estimate": 48
    },
    {
      "id": "api/commands/nextall#find-all-of-the-following-siblings-of-each-li-keep-only-the-ones-with-a-class-selected",
      "doc_id": "api/commands/nextall",
      "heading": "Find all of the following siblings of each li. Keep only the ones with a class selected",
      "heading_level": 4,
      "content_markdown": "#### Find all of the following siblings of each li. Keep only the ones with a class `selected`\n\n```\n<ul>\n  <li>apples</li>\n  <li>oranges</li>\n  <li>bananas</li>\n  <li class=\"selected\">pineapples</li>\n  <li>grapes</li>\n</ul>\n```\n\n```\n// yields <li>pineapples</li>\ncy.get('li').nextAll('.selected')\n```\n",
      "section": "api",
      "anchors": [
        "find-all-of-the-following-siblings-of-each-li-keep-only-the-ones-with-a-class-selected"
      ],
      "path": "/llm/json/chunked/api/commands/nextall.json",
      "token_estimate": 45
    },
    {
      "id": "api/commands/nextall#rules",
      "doc_id": "api/commands/nextall",
      "heading": "Rules",
      "heading_level": 2,
      "content_markdown": "## Rules\n\n### Requirements\n\n*   `.nextAll()` requires being chained off a command that yields DOM element(s).\n\n### Assertions\n\n*   `.nextAll()` will automatically [retry](/llm/markdown/app/core-concepts/retry-ability.md) until the element(s) [exist in the DOM](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Implicit-Assertions).\n*   `.nextAll()` will automatically [retry](/llm/markdown/app/core-concepts/retry-ability.md) until all chained assertions have passed.\n\n### Timeouts\n\n*   `.nextAll()` can time out waiting for the element(s) to [exist in the DOM](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Implicit-Assertions).\n*   `.nextAll()` can time out waiting for assertions you've added to pass.\n",
      "section": "api",
      "anchors": [
        "rules"
      ],
      "path": "/llm/json/chunked/api/commands/nextall.json",
      "token_estimate": 92
    },
    {
      "id": "api/commands/nextall#command-log",
      "doc_id": "api/commands/nextall",
      "heading": "Command Log",
      "heading_level": 2,
      "content_markdown": "## Command Log\n\n**_Find all elements following the `.active` li_**\n\n```\ncy.get('.left-nav').find('li.active').nextAll()\n```\n\nThe commands above will display in the Command Log as:\n\nWhen clicking on `nextAll` within the command log, the console outputs the following:\n",
      "section": "api",
      "anchors": [
        "command-log"
      ],
      "path": "/llm/json/chunked/api/commands/nextall.json",
      "token_estimate": 48
    }
  ]
}