Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right Click command addition in Selenium IDE #754

Open
cdifino opened this issue Jul 24, 2019 · 7 comments
Open

Right Click command addition in Selenium IDE #754

cdifino opened this issue Jul 24, 2019 · 7 comments

Comments

@cdifino
Copy link

cdifino commented Jul 24, 2019

🚀 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
Copy link
Author

cdifino commented Jul 25, 2019

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?

@tourdedave
Copy link
Contributor

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).

@cdifino
Copy link
Author

cdifino commented Jul 29, 2019

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

@tourdedave
Copy link
Contributor

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".

@stale stale bot added the stale label Sep 2, 2019
@tourdedave tourdedave removed the stale label Sep 2, 2019
@SeleniumHQ SeleniumHQ deleted a comment from stale bot Sep 2, 2019
@SrslyJosh
Copy link

+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.)

@nexocentric
Copy link

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.

@yuzhva
Copy link

yuzhva commented Sep 7, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants