Closed Bug 1747878 Opened 3 years ago Closed 3 years ago

Clicks outside the context menu are not dismissing the context menu

Categories

(Remote Protocol :: Marionette, defect)

Firefox 95
defect

Tracking

(firefox95 wontfix, firefox96 wontfix, firefox97 affected)

RESOLVED DUPLICATE of bug 1702633
Tracking Status
firefox95 --- wontfix
firefox96 --- wontfix
firefox97 --- affected

People

(Reporter: rajapriya.jr, Unassigned)

Details

Attachments

(3 files)

Attached image context_click_menu_not_quitting.jpg (deleted) —

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36

Steps to reproduce:

I'm trying to simulate context-click action in the latest firefox (my version is Mozilla Firefox 95.0.1). So currently using the 'Actions' class from the python-based marionette driver for simulating the context-click.

Here is my test code to simulate context-click using pointer actions.

start
from marionette_driver.marionette import ActionSequence, Actions, Marionette
from marionette_driver.by import By

driver1 = Marionette()
driver1.start_session()
driver1.navigate("https://www.linkedin.com/")

element = driver1.find_element(By.LINK_TEXT, "Join now")

touchHandler = ActionSequence(driver1, "pointer", "mouse", {"pointerType":"mouse"})

touchHandler.pointer_move(0, 0, origin=element).pointer_down(button=2).pause(1500).pointer_up(button=2).perform()

touchHandler.pointer_move(10, 10, origin="viewport").pointer_down().pointer_up().pointer_down().pointer_up().perform()

end

Here, sending double clicks in order to

  1. quit the context menu first (button=2 indicates right-click, this triggers context-click on the particular element)
  2. then it will deselect the element.

Actual results:

The problem is element got deselected in my case but the context menu still exists.

Not sure why the menu is not quitting though the element is deselected.

Issue occurrence is 5/10 trials (not always)

Expected results:

The expected behavior is (in case the element is chosen for context-click),

  1. For the first left click, it should close the menu.
  2. Then the element must be deselected when sending 2nd left click.

The Bugbug bot thinks this bug should belong to the 'Firefox::Menus' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Menus
Severity: -- → S1
OS: Unspecified → Linux
Priority: -- → P1
Hardware: Unspecified → x86_64

Hey Rajapriya,
Can you test the issue while in Safe Mode? You can find helpful info here : https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode .
Also a fresh new profile could help. You can find more about creating a new profile here : https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problems#w_6-create-a-new-firefox-profile .
If possible, you can test this issue on the nightly build as well. Download the build from : https://www.mozilla.org/en-US/firefox/nightly/all/ .

Flags: needinfo?(rajapriyar10595)

Hi Andrei,

Just to update: We use the below command to run the firefox with our profile.
firefox -marionette -safe-mode --profile /home/rar/.mozilla/firefox/mvl93j2z.owmc_port2828-1639568481032 --new-instance

And tested the issue in the ways you mentioned previously and we still observe the issue in these ways too.

  1. By running in safe mode
  2. By creating new profile and customized only the below setting.
    dom.w3c_touch_events.enabled set to 1 (was 2)
  3. In the nightly build

I need to know one thing first that is any config setting is required in simulating touch actions using pointer events. Because I referred some mozilla' test code to test context click action (test code can be found here - https://searchfox.org/mozilla-central/source/testing/web-platform/tests/pointerevents/pointerevent_contextmenu_is_a_pointerevent.html), verified the pointer events which we send are proper (If anything is wrong here, please correct me).

mozilla-central/testing/web-platform/tests/pointerevents/pointerevent_contextmenu_is_a_pointerevent.html

...
actions = actions.addPointer(testPointer, inputSource)
.pointerMove(0,0, {sourceName:testPointer, origin:target})
.pointerDown({sourceName:testPointer, button:actions.ButtonType.RIGHT})
.pause(inputSource === "touch" ? 1500 : 0, "pointer", {sourceName:testPointer})
.pointerUp({sourceName:testPointer, button:actions.ButtonType.RIGHT});
...

Also, observed some other issues with this action.

  1. context menu is not quitting (the current issue)
  2. sometimes menu will come and will quit immediately without getting any user option.
  3. sometimes element will only be selected but menu will not come.

Please comment.

Flags: needinfo?(rajapriyar10595)
Version: unspecified → Firefox 95
Severity: -- → S1
Priority: -- → P1

Please don't set severity and priorities - those are meant to be set by the engineers investigating and fixing the bugs who can weigh this in context with other bugs within their component. Furthermore, this bug doesn't meet the criteria for neither P1 priority nor S1 severity.

Severity: S1 → --
Priority: P1 → --

I assume that it is possible to close the context menu by sending double left clicks, that's why we are sending double clicks once the context click is triggered. Please comment if it is wrong.

Do we have any other ways to close the context menu?

(In reply to Rajapriya Radhakrishnan from comment #5)

Do we have any other ways to close the context menu?

Maybe whimboo can help.

Component: Menus → Marionette
Flags: needinfo?(hskupin)
Product: Firefox → Testing
Summary: contextClick' menu is not quitting in firefox browser → Clicks outside the context menu are not dismissing the context menu

Note that the context menu is not part of the webdriver specification. It's a browser specific element, and as such not being part of any web page you are trying to automate.

The click is not closing the context menu because it is a native element. For details see bug 1702633, which I'm going to use and dupe this bug against.

If you still have to handle the context menu there is some code that exercises exactly what you want:

https://searchfox.org/mozilla-central/rev/682e5a82d403974bacb779c1db515962d946be48/testing/marionette/harness/marionette_harness/tests/unit/test_mouse_action.py#115-117

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
OS: Linux → All
Hardware: x86_64 → All
Resolution: --- → DUPLICATE

Hi Henrik,

Thanks for your updates. Now we are able to close the pop-up properly by calling the hidePopup.

As I already mentioned in the comment #3, we still have some other issues while the pop-up is shown.

  1. sometimes pop-up will come but it is getting hidden abruptly without any user inputs. Please see the attached video - rightclick_popup_is_hidden_abruptly.mp4.
    Occurrence - Random

  2. sometimes element will only be selected but pop-up wont come. Please check the video rightclick_popup_is_not_diplayed_intermittently.mp4, where I am sending right click action to 'Sign in' button, but pop-up is not coming.
    Occurrence - Random

Please note, we trigger the right click action like below.
touchHandler = ActionSequence(driver1, "pointer", "mouse", {"pointerType":"mouse"})
touchHandler.pointer_move(0, 0, origin=element).pointer_down(button=2).pointer_up(button=2).perform()

Could you please check these too.

Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---

Please note that Bugzilla is a bug tracker and not a support site. If you have issues that you want to get clarification for please use our mailing list at https://groups.google.com/a/mozilla.org/g/dev-webdriver.

Also this bug was for closing the context menu and that means it's still a dupe of bug 1702633. Please do not reopen the bug again. Thanks.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago3 years ago
Flags: needinfo?(hskupin)
Resolution: --- → DUPLICATE
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: