selenium-ide icon indicating copy to clipboard operation
selenium-ide copied to clipboard

Right Click command addition in Selenium IDE

Open cdifino opened this issue 6 years ago • 9 comments

🚀 Feature Proposal

I would like to add Right Click as a new command in Selenium IDE.

Motivation

I need to create a selenium IDE script that is able to perform right click in a specific object to get access to the object's context menu.

Example

Right click on a specific target to get access to an option in its context menu.

cdifino avatar Jul 24 '19 22:07 cdifino

I noticed you have the logic for the ContextMenu command in selenium-ide/packages/selenium-ide/src/content/selenium-api.js but it is not fully implemented. Is there any reason why you decided not to proceed further with the implementation?

cdifino avatar Jul 25 '19 05:07 cdifino

We didn't implement it since In Selenium IDE we're not able to open a native menu because it relies on synthetic events. In the command-line runner we can since it uses playback on WebDriver. While some sites/applications override the native context menu and offer their own UI, our implementation wouldn't be complete due to this disparity. Once we move Selenium IDE to electron we'll be able to offer it.

If someone wants to, they could make this functionality available through a plugin (for the current extension-based version of Selenium IDE) or implement it in the electron branch of the IDE (e.g., master).

tourdedave avatar Jul 28 '19 07:07 tourdedave

@tourdedave Do you have an estimate of when are you planning to move Selenium IDE to electron? Thank you for the explanation!

cdifino avatar Jul 29 '19 21:07 cdifino

The move to electron is our highest priority, but we don't have an estimate. It's a large undertaking, so the timescale is easily "months", not "weeks".

tourdedave avatar Jul 30 '19 07:07 tourdedave

+1 to this. I just tried using Selenium for the first time and I can't complete the automation I need because it relies on being able to get a contextual menu. (The page is intercepting the right-click event and rendering its own contextual menu with JS.)

SrslyJosh avatar Oct 03 '19 21:10 SrslyJosh

Is there a preview or alpha version of the the Selenium IDE Electron version?

I'm trying to make some business decisions based on the future of Selenium and the Selenium IDE Electron version. This may not be the correct thread, but point me to the right direction and I'll make my comment in the correct one.

I'm even willing to alpha test the product, just so I can understand where it is.

Thanks for your help.

nexocentric avatar Jan 14 '20 16:01 nexocentric

After spending a couple of days for research, I finally found the way to simulate Right-click in Selenium IDE through the execute script command:

const el = document.querySelector('CSS_SELECTOR_GOES_HERE');

const eventContextMenu = new MouseEvent('contextmenu', {
    bubbles: true,
});

el.dispatchEvent(eventContextMenu);

The trick here is that bubbles: true is required param.

Screenshot 2020-09-07 at 15 57 43

yuzhva avatar Sep 07 '20 12:09 yuzhva

May I know when Selenium IDE going to fix the right click issue? or add Right Click as a new command in Selenium IDE. It has been a long time since last Selenium IDE update is available. When is the next release?

As even I am using the above suggestion ... the right click action is not happening.

Image

Joey-339 avatar Jul 24 '25 04:07 Joey-339

https://github.com/SeleniumHQ/selenium-ide/issues/1872#issuecomment-2725000068

dwarwick avatar Jul 24 '25 15:07 dwarwick