Right Click command addition in Selenium IDE
🚀 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.
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?
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 Do you have an estimate of when are you planning to move Selenium IDE to electron? Thank you for the explanation!
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".
+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.)
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.
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.
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.
https://github.com/SeleniumHQ/selenium-ide/issues/1872#issuecomment-2725000068