{
  "doc": {
    "id": "api/commands/rightclick",
    "title": "rightclick | Cypress Documentation",
    "description": "Right click a DOM element in Cypress.",
    "section": "api",
    "source_path": "/llm/markdown/api/commands/rightclick.md",
    "version": "24a73f8a97175663aaffd3b016289fb2a523a4ea",
    "updated_at": "2026-05-14T20:17:33.301Z",
    "headings": [
      {
        "id": "api/commands/rightclick#rightclick",
        "text": "rightclick",
        "level": 1
      },
      {
        "id": "api/commands/rightclick#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/commands/rightclick#usage",
        "text": "Usage",
        "level": 3
      },
      {
        "id": "api/commands/rightclick#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/commands/rightclick#yields-learn-about-subject-management",
        "text": "Yields Learn about subject management",
        "level": 3
      },
      {
        "id": "api/commands/rightclick#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/commands/rightclick#no-args",
        "text": "No Args",
        "level": 3
      },
      {
        "id": "api/commands/rightclick#right-click-the-menu",
        "text": "Right click the menu",
        "level": 4
      },
      {
        "id": "api/commands/rightclick#position",
        "text": "Position",
        "level": 3
      },
      {
        "id": "api/commands/rightclick#specify-a-corner-of-the-element-to-right-click",
        "text": "Specify a corner of the element to right click",
        "level": 4
      },
      {
        "id": "api/commands/rightclick#coordinates",
        "text": "Coordinates",
        "level": 3
      },
      {
        "id": "api/commands/rightclick#specify-explicit-coordinates-relative-to-the-top-left-corner",
        "text": "Specify explicit coordinates relative to the top left corner",
        "level": 4
      },
      {
        "id": "api/commands/rightclick#options",
        "text": "Options",
        "level": 3
      },
      {
        "id": "api/commands/rightclick#force-a-right-click-regardless-of-its-actionable-state",
        "text": "Force a right click regardless of its actionable state",
        "level": 4
      },
      {
        "id": "api/commands/rightclick#force-a-right-click-with-position-argument",
        "text": "Force a right click with position argument",
        "level": 4
      },
      {
        "id": "api/commands/rightclick#force-a-right-click-with-relative-coordinates",
        "text": "Force a right click with relative coordinates",
        "level": 4
      },
      {
        "id": "api/commands/rightclick#right-click-all-buttons-found-on-the-page",
        "text": "Right click all buttons found on the page",
        "level": 4
      },
      {
        "id": "api/commands/rightclick#right-click-with-key-combinations",
        "text": "Right click with key combinations",
        "level": 4
      },
      {
        "id": "api/commands/rightclick#command-right-click",
        "text": "Command right click",
        "level": 5
      },
      {
        "id": "api/commands/rightclick#notes",
        "text": "Notes",
        "level": 2
      },
      {
        "id": "api/commands/rightclick#actionability",
        "text": "Actionability",
        "level": 3
      },
      {
        "id": "api/commands/rightclick#the-element-must-first-reach-actionability",
        "text": "The element must first reach actionability",
        "level": 4
      },
      {
        "id": "api/commands/rightclick#rules",
        "text": "Rules",
        "level": 2
      },
      {
        "id": "api/commands/rightclick#requirements-learn-about-chaining-commands",
        "text": "Requirements Learn about chaining commands",
        "level": 3
      },
      {
        "id": "api/commands/rightclick#assertions-learn-about-assertions",
        "text": "Assertions Learn about assertions",
        "level": 3
      },
      {
        "id": "api/commands/rightclick#timeouts-learn-about-timeouts",
        "text": "Timeouts Learn about timeouts",
        "level": 3
      },
      {
        "id": "api/commands/rightclick#command-log",
        "text": "Command Log",
        "level": 2
      },
      {
        "id": "api/commands/rightclick#history",
        "text": "History",
        "level": 2
      },
      {
        "id": "api/commands/rightclick#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/commands/rightclick#syntax",
      "doc_id": "api/commands/rightclick",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\n.rightclick().rightclick(options).rightclick(position).rightclick(position, options).rightclick(x, y).rightclick(x, y, options)\n```\n\n### Usage\n\n**Correct Usage**\n\n```\ncy.get('.menu').rightclick() // Right click on .menucy.focused().rightclick() // Right click on el with focuscy.contains('Today').rightclick() // Right click on first el containing 'Today'\n```\n\n**Incorrect Usage**\n\n```\ncy.rightclick('button') // Errors, cannot be chained off 'cy'cy.window().rightclick() // Errors, 'window' does not yield DOM element\n```\n\n### Arguments\n\n**position _(String)_**\n\nThe position where the right click should be issued. The `center` position is the default position. Valid positions are `topLeft`, `top`, `topRight`, `left`, `center`, `right`, `bottomLeft`, `bottom`, and `bottomRight`.\n\n**x _(Number)_**\n\nThe distance in pixels from the element's left to issue the right click.\n\n**y _(Number)_**\n\nThe distance in pixels from the element's top to issue the right click.\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.rightclick()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `altKey` | `false` | Activates the alt key (option key for Mac). Aliases: `optionKey`. |\n| `animationDistanceThreshold` | [`animationDistanceThreshold`](/llm/markdown/app/references/configuration.md#Actionability) | The distance in pixels an element must exceed over time to be [considered animating](/llm/markdown/app/core-concepts/interacting-with-elements.md#Animations). |\n| `ctrlKey` | `false` | Activates the control key. Aliases: `controlKey`. |\n| `force` | `false` | Forces the action, disables [waiting for actionability](#Assertions) |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `metaKey` | `false` | Activates the meta key (Windows key or command key for Mac). Aliases: `commandKey`, `cmdKey`. |\n| `multiple` | `false` | Serially click multiple elements |\n| `scrollBehavior` | [`scrollBehavior`](/llm/markdown/app/references/configuration.md#Actionability) | Viewport position to where an element [should be scrolled](/llm/markdown/app/core-concepts/interacting-with-elements.md#Scrolling) before executing the command |\n| `shiftKey` | `false` | Activates the shift key. |\n| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.rightclick()` to resolve before [timing out](#Timeouts) |\n| `waitForAnimations` | [`waitForAnimations`](/llm/markdown/app/references/configuration.md#Actionability) | Whether to wait for elements to [finish animating](/llm/markdown/app/core-concepts/interacting-with-elements.md#Animations) before executing the command. |\n\n### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n*   `.rightclick()` yields the same subject it was given.\n*   It is [unsafe](/llm/markdown/app/core-concepts/retry-ability.md#Only-queries-are-retried) to chain further commands that rely on the subject after `.rightclick()`.\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 459
    },
    {
      "id": "api/commands/rightclick#usage",
      "doc_id": "api/commands/rightclick",
      "heading": "Usage",
      "heading_level": 3,
      "content_markdown": "### Usage\n\n**Correct Usage**\n\n```\ncy.get('.menu').rightclick() // Right click on .menucy.focused().rightclick() // Right click on el with focuscy.contains('Today').rightclick() // Right click on first el containing 'Today'\n```\n\n**Incorrect Usage**\n\n```\ncy.rightclick('button') // Errors, cannot be chained off 'cy'cy.window().rightclick() // Errors, 'window' does not yield DOM element\n```\n",
      "section": "api",
      "anchors": [
        "usage"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 63
    },
    {
      "id": "api/commands/rightclick#arguments",
      "doc_id": "api/commands/rightclick",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**position _(String)_**\n\nThe position where the right click should be issued. The `center` position is the default position. Valid positions are `topLeft`, `top`, `topRight`, `left`, `center`, `right`, `bottomLeft`, `bottom`, and `bottomRight`.\n\n**x _(Number)_**\n\nThe distance in pixels from the element's left to issue the right click.\n\n**y _(Number)_**\n\nThe distance in pixels from the element's top to issue the right click.\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.rightclick()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `altKey` | `false` | Activates the alt key (option key for Mac). Aliases: `optionKey`. |\n| `animationDistanceThreshold` | [`animationDistanceThreshold`](/llm/markdown/app/references/configuration.md#Actionability) | The distance in pixels an element must exceed over time to be [considered animating](/llm/markdown/app/core-concepts/interacting-with-elements.md#Animations). |\n| `ctrlKey` | `false` | Activates the control key. Aliases: `controlKey`. |\n| `force` | `false` | Forces the action, disables [waiting for actionability](#Assertions) |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `metaKey` | `false` | Activates the meta key (Windows key or command key for Mac). Aliases: `commandKey`, `cmdKey`. |\n| `multiple` | `false` | Serially click multiple elements |\n| `scrollBehavior` | [`scrollBehavior`](/llm/markdown/app/references/configuration.md#Actionability) | Viewport position to where an element [should be scrolled](/llm/markdown/app/core-concepts/interacting-with-elements.md#Scrolling) before executing the command |\n| `shiftKey` | `false` | Activates the shift key. |\n| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.rightclick()` to resolve before [timing out](#Timeouts) |\n| `waitForAnimations` | [`waitForAnimations`](/llm/markdown/app/references/configuration.md#Actionability) | Whether to wait for elements to [finish animating](/llm/markdown/app/core-concepts/interacting-with-elements.md#Animations) before executing the command. |\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 344
    },
    {
      "id": "api/commands/rightclick#yields-learn-about-subject-management",
      "doc_id": "api/commands/rightclick",
      "heading": "Yields Learn about subject management",
      "heading_level": 3,
      "content_markdown": "### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n*   `.rightclick()` yields the same subject it was given.\n*   It is [unsafe](/llm/markdown/app/core-concepts/retry-ability.md#Only-queries-are-retried) to chain further commands that rely on the subject after `.rightclick()`.\n",
      "section": "api",
      "anchors": [
        "yields-learn-about-subject-management"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 40
    },
    {
      "id": "api/commands/rightclick#examples",
      "doc_id": "api/commands/rightclick",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n### No Args\n\n#### Right click the menu\n\n```\ncy.get('#open-menu').rightclick()\n```\n\n### Position\n\n#### Specify a corner of the element to right click\n\nRight click the top right corner of the DOM element.\n\n```\ncy.get('#open-menu').rightclick('topRight')\n```\n\n### Coordinates\n\n#### Specify explicit coordinates relative to the top left corner\n\nThe right click below will be issued inside of the element (15px from the left and 40px from the top).\n\n```\ncy.get('#open-menu').rightclick(15, 40)\n```\n\n### Options\n\n#### Force a right click regardless of its actionable state\n\nForcing a right click overrides the [actionable checks](/llm/markdown/app/core-concepts/interacting-with-elements.md#Forcing) Cypress applies and will automatically fire the events.\n\n```\ncy.get('#open-menu').rightclick({ force: true })\n```\n\n#### Force a right click with position argument\n\n```\ncy.get('#open-menu').rightclick('bottomLeft', { force: true })\n```\n\n#### Force a right click with relative coordinates\n\n```\ncy.get('#open-menu').rightclick(5, 60, { force: true })\n```\n\n#### Right click all buttons found on the page\n\nBy default, Cypress will error if you're trying to right click multiple elements. By passing `{ multiple: true }` Cypress will iteratively apply the right click to each element and will also log to the [Command Log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) multiple times.\n\n```\ncy.get('.open-menu').rightclick({ multiple: true })\n```\n\n#### Right click with key combinations\n\nThe `.rightclick()` command may also be fired with key modifiers in order to simulate holding key combinations while right clicking, such as `ALT + rightclick`.\n\nYou can also use key combinations during [.type()](/llm/markdown/api/commands/type.md). This offers options to hold down keys across multiple commands. See [Key Combinations](/llm/markdown/api/commands/type.md#Key-Combinations) for more information.\n\nThe following key can be combined with `.rightclick()` through the `options`..\n\n| Option | Notes |\n| --- | --- |\n| `altKey` | Activates the alt key (option key for Mac). Aliases: `optionKey`. |\n| `ctrlKey` | Activates the control key. Aliases: `controlKey`. |\n| `metaKey` | Activates the meta key (Windows key or command key for Mac). Aliases: `commandKey`, `cmdKey`. |\n| `shiftKey` | Activates the shift key. |\n\n##### Command right click\n\n```\n// execute a CMD + right click on the .menu-itemcy.get('.menu-item').rightclick({  metaKey: true,})\n```\n",
      "section": "api",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 449
    },
    {
      "id": "api/commands/rightclick#coordinates",
      "doc_id": "api/commands/rightclick",
      "heading": "Coordinates",
      "heading_level": 3,
      "content_markdown": "### Coordinates\n\n#### Specify explicit coordinates relative to the top left corner\n\nThe right click below will be issued inside of the element (15px from the left and 40px from the top).\n\n```\ncy.get('#open-menu').rightclick(15, 40)\n```\n",
      "section": "api",
      "anchors": [
        "coordinates"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 48
    },
    {
      "id": "api/commands/rightclick#specify-explicit-coordinates-relative-to-the-top-left-corner",
      "doc_id": "api/commands/rightclick",
      "heading": "Specify explicit coordinates relative to the top left corner",
      "heading_level": 4,
      "content_markdown": "#### Specify explicit coordinates relative to the top left corner\n\nThe right click below will be issued inside of the element (15px from the left and 40px from the top).\n\n```\ncy.get('#open-menu').rightclick(15, 40)\n```\n",
      "section": "api",
      "anchors": [
        "specify-explicit-coordinates-relative-to-the-top-left-corner"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 45
    },
    {
      "id": "api/commands/rightclick#options",
      "doc_id": "api/commands/rightclick",
      "heading": "Options",
      "heading_level": 3,
      "content_markdown": "### Options\n\n#### Force a right click regardless of its actionable state\n\nForcing a right click overrides the [actionable checks](/llm/markdown/app/core-concepts/interacting-with-elements.md#Forcing) Cypress applies and will automatically fire the events.\n\n```\ncy.get('#open-menu').rightclick({ force: true })\n```\n\n#### Force a right click with position argument\n\n```\ncy.get('#open-menu').rightclick('bottomLeft', { force: true })\n```\n\n#### Force a right click with relative coordinates\n\n```\ncy.get('#open-menu').rightclick(5, 60, { force: true })\n```\n\n#### Right click all buttons found on the page\n\nBy default, Cypress will error if you're trying to right click multiple elements. By passing `{ multiple: true }` Cypress will iteratively apply the right click to each element and will also log to the [Command Log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) multiple times.\n\n```\ncy.get('.open-menu').rightclick({ multiple: true })\n```\n\n#### Right click with key combinations\n\nThe `.rightclick()` command may also be fired with key modifiers in order to simulate holding key combinations while right clicking, such as `ALT + rightclick`.\n\nYou can also use key combinations during [.type()](/llm/markdown/api/commands/type.md). This offers options to hold down keys across multiple commands. See [Key Combinations](/llm/markdown/api/commands/type.md#Key-Combinations) for more information.\n\nThe following key can be combined with `.rightclick()` through the `options`..\n\n| Option | Notes |\n| --- | --- |\n| `altKey` | Activates the alt key (option key for Mac). Aliases: `optionKey`. |\n| `ctrlKey` | Activates the control key. Aliases: `controlKey`. |\n| `metaKey` | Activates the meta key (Windows key or command key for Mac). Aliases: `commandKey`, `cmdKey`. |\n| `shiftKey` | Activates the shift key. |\n\n##### Command right click\n\n```\n// execute a CMD + right click on the .menu-itemcy.get('.menu-item').rightclick({  metaKey: true,})\n```\n",
      "section": "api",
      "anchors": [
        "options"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 351
    },
    {
      "id": "api/commands/rightclick#force-a-right-click-regardless-of-its-actionable-state",
      "doc_id": "api/commands/rightclick",
      "heading": "Force a right click regardless of its actionable state",
      "heading_level": 4,
      "content_markdown": "#### Force a right click regardless of its actionable state\n\nForcing a right click overrides the [actionable checks](/llm/markdown/app/core-concepts/interacting-with-elements.md#Forcing) Cypress applies and will automatically fire the events.\n\n```\ncy.get('#open-menu').rightclick({ force: true })\n```\n",
      "section": "api",
      "anchors": [
        "force-a-right-click-regardless-of-its-actionable-state"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 43
    },
    {
      "id": "api/commands/rightclick#right-click-all-buttons-found-on-the-page",
      "doc_id": "api/commands/rightclick",
      "heading": "Right click all buttons found on the page",
      "heading_level": 4,
      "content_markdown": "#### Right click all buttons found on the page\n\nBy default, Cypress will error if you're trying to right click multiple elements. By passing `{ multiple: true }` Cypress will iteratively apply the right click to each element and will also log to the [Command Log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) multiple times.\n\n```\ncy.get('.open-menu').rightclick({ multiple: true })\n```\n",
      "section": "api",
      "anchors": [
        "right-click-all-buttons-found-on-the-page"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 72
    },
    {
      "id": "api/commands/rightclick#right-click-with-key-combinations",
      "doc_id": "api/commands/rightclick",
      "heading": "Right click with key combinations",
      "heading_level": 4,
      "content_markdown": "#### Right click with key combinations\n\nThe `.rightclick()` command may also be fired with key modifiers in order to simulate holding key combinations while right clicking, such as `ALT + rightclick`.\n\nYou can also use key combinations during [.type()](/llm/markdown/api/commands/type.md). This offers options to hold down keys across multiple commands. See [Key Combinations](/llm/markdown/api/commands/type.md#Key-Combinations) for more information.\n\nThe following key can be combined with `.rightclick()` through the `options`..\n\n| Option | Notes |\n| --- | --- |\n| `altKey` | Activates the alt key (option key for Mac). Aliases: `optionKey`. |\n| `ctrlKey` | Activates the control key. Aliases: `controlKey`. |\n| `metaKey` | Activates the meta key (Windows key or command key for Mac). Aliases: `commandKey`, `cmdKey`. |\n| `shiftKey` | Activates the shift key. |\n\n##### Command right click\n\n```\n// execute a CMD + right click on the .menu-itemcy.get('.menu-item').rightclick({  metaKey: true,})\n```\n",
      "section": "api",
      "anchors": [
        "right-click-with-key-combinations"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 192
    },
    {
      "id": "api/commands/rightclick#rules",
      "doc_id": "api/commands/rightclick",
      "heading": "Rules",
      "heading_level": 2,
      "content_markdown": "## Rules\n\n### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)\n\n*   `.rightclick()` requires being chained off a command that yields DOM element(s).\n\n### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)\n\n*   `.rightclick()` will automatically wait for the element to reach an [actionable state](/llm/markdown/app/core-concepts/interacting-with-elements.md).\n*   `.rightclick()` will automatically [retry](/llm/markdown/app/core-concepts/retry-ability.md) until all chained assertions have passed.\n\n### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)\n\n*   `.rightclick()` can time out waiting for the element to reach an [actionable state](/llm/markdown/app/core-concepts/interacting-with-elements.md).\n*   `.rightclick()` can time out waiting for assertions you've added to pass.\n",
      "section": "api",
      "anchors": [
        "rules"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 107
    },
    {
      "id": "api/commands/rightclick#timeouts-learn-about-timeouts",
      "doc_id": "api/commands/rightclick",
      "heading": "Timeouts Learn about timeouts",
      "heading_level": 3,
      "content_markdown": "### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)\n\n*   `.rightclick()` can time out waiting for the element to reach an [actionable state](/llm/markdown/app/core-concepts/interacting-with-elements.md).\n*   `.rightclick()` can time out waiting for assertions you've added to pass.\n",
      "section": "api",
      "anchors": [
        "timeouts-learn-about-timeouts"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 41
    },
    {
      "id": "api/commands/rightclick#command-log",
      "doc_id": "api/commands/rightclick",
      "heading": "Command Log",
      "heading_level": 2,
      "content_markdown": "## Command Log\n\n**_Right click the DOM element_**\n\n```\ncy.get('.rightclick-action-div').rightclick()\n```\n\nThe commands above will display in the Command Log as:\n\nWhen clicking on `rightclick` within the command log, the console outputs the following:\n",
      "section": "api",
      "anchors": [
        "command-log"
      ],
      "path": "/llm/json/chunked/api/commands/rightclick.json",
      "token_estimate": 45
    }
  ]
}