Intermittent issues when the right click' popup is shown

107 views
Skip to first unread message

Rajapriya Radhakrishnan

unread,
Jan 11, 2022, 1:30:29 AM1/11/22
to dev-we...@mozilla.org, dev-we...@mozilla.org
Hi Skupin and Team,

In continuation with  the ticket -  1747878 - Clicks outside the context menu are not dismissing the context menu (mozilla.org)


We still facing 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, here sending action to 'Sign in' button.

2. next issue is, element will only be selected but pop-up wont come at all. Please check the video rightclick_popup_is_not_diplayed_intermittently.mp4, where I am sending right click action to 'Join now' button, but pop-up is not coming.

We trigger the right click action as below mentioned:
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 and give your comments.


With regards,
Rajapriya R.
rightclick_popup_is_not_diplayed_intermittently.mp4
rightclick_popup_is_hidden_abruptly.mp4

Henrik Skupin

unread,
Jan 24, 2022, 11:11:27 AM1/24/22
to dev-we...@mozilla.org, rajapri...@gmail.com, dev-we...@mozilla.org
Hi,

Sorry for the delay in answering your question. So I had a look and used the following code to replicate your test:

self.marionette.navigate(inline("<div>Test</div"))
element = self.marionette.find_element(By.TAG_NAME, "div")

for i in range(1, 100):
touchHandler = ActionSequence(self.marionette, "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()

def context_menu_state():
with self.marionette.using_context("chrome"):
cm_el = self.marionette.find_element(By.ID, "contentAreaContextMenu")
return cm_el.get_property("state")

Wait(self.marionette).until(
lambda _: context_menu_state() == "open",
message="Context menu did not open",
)
time.sleep(2)
with self.marionette.using_context("chrome"):
cm_el = self.marionette.find_element(By.ID, "contentAreaContextMenu")
self.marionette.execute_script(
"arguments[0].hidePopup()", script_args=(cm_el,)
)
Wait(self.marionette).until(
lambda _: context_menu_state() == "closed",
message="Context menu did not close",
)
time.sleep(2)

But running this code I never see any of your described issues when really commenting out the second action sequence which is not needed. Can you please run this code and tell me if you can still see the problem? If yes please provide an excerpt from the trace logs.

Thanks.
Message has been deleted
Message has been deleted
Message has been deleted

Rajapriya Radhakrishnan

unread,
Mar 31, 2022, 2:55:20 AM3/31/22
to Henrik Skupin, dev-we...@mozilla.org, rav...@gmail.com
Hi skupin,

For context click' abrupt quit issue, tried some cases by deleting cookies and cached data.

I deleted all the temporary files generated in the below 2x folders and observed that the issue occurrence is reduced when clearing the data including cache and so on before starting the browser in the multiple runs.

/home/rar/.mozilla/firefox/98jr84hq.rar
total 16380
drwx------ 12 rar rar    4096 Mar 29 22:17 .
drwx------  5 rar rar    4096 Mar 29 22:09 ..
-rw-rw-r--  1 rar rar   29231 Mar 29 22:13 activity-stream.discovery_stream.json
-rw-rw-r--  1 rar rar      24 Mar 29 22:11 addons.json
-rw-rw-r--  1 rar rar    4698 Mar 29 22:13 addonStartup.json.lz4
drwxr-xr-x  2 rar rar    4096 Mar 29 22:11 bookmarkbackups
-rw-rw-r--  1 rar rar     204 Mar 29 22:14 broadcast-listeners.json
drwx------  3 rar rar    4096 Mar 29 22:11 browser-extension-data
-rw-------  1 rar rar  229376 Mar 29 22:12 cert9.db
-rw-------  1 rar rar     154 Mar 29 22:13 compatibility.ini
-rw-rw-r--  1 rar rar     939 Mar 29 22:11 containers.json
-rw-r--r--  1 rar rar  229376 Mar 29 22:11 content-prefs.sqlite
-rw-r--r--  1 rar rar  524288 Mar 29 22:13 cookies.sqlite
-rw-r--r--  1 rar rar  524704 Mar 29 22:17 cookies.sqlite-wal
drwx------  3 rar rar    4096 Mar 29 22:14 crashes
drwxr-xr-x  4 rar rar    4096 Mar 29 22:14 datareporting
-rw-rw-r--  1 rar rar    1455 Mar 29 22:13 extension-preferences.json
-rw-rw-r--  1 rar rar   43918 Mar 29 22:11 extensions.json
-rw-r--r--  1 rar rar 5242880 Mar 29 22:13 favicons.sqlite
-rw-r--r--  1 rar rar 2033136 Mar 29 22:13 favicons.sqlite-wal
drwxr-xr-x  3 rar rar    4096 Mar 29 22:14 gmp-gmpopenh264
-rw-rw-r--  1 rar rar     410 Mar 29 22:11 handlers.json
-rw-------  1 rar rar  294912 Mar 29 22:11 key4.db
lrwxrwxrwx  1 rar rar      15 Mar 29 22:13 lock -> 127.0.1.1:+4351
-rw-rw-r--  1 rar rar       4 Mar 29 22:13 MarionetteActivePort
drwx------  2 rar rar    4096 Mar 29 22:11 minidumps
-rw-rw-r--  1 rar rar       0 Mar 29 22:13 .parentlock
-rw-r--r--  1 rar rar   98304 Mar 29 22:13 permissions.sqlite
-rw-------  1 rar rar     465 Mar 29 22:11 pkcs11.txt
-rw-r--r--  1 rar rar 5242880 Mar 29 22:13 places.sqlite
-rw-r--r--  1 rar rar 2393848 Mar 29 22:13 places.sqlite-wal
-rw-------  1 rar rar   13695 Mar 29 22:17 prefs.js
-rw-r--r--  1 rar rar   65536 Mar 29 22:13 protections.sqlite
drwx------  2 rar rar    4096 Mar 29 22:11 saved-telemetry-pings
-rw-rw-r--  1 rar rar     268 Mar 29 22:13 search.json.mozlz4
drwxrwxr-x  2 rar rar    4096 Mar 29 22:15 security_state
-rw-rw-r--  1 rar rar      90 Mar 29 22:13 sessionCheckpoints.json
drwxr-xr-x  2 rar rar    4096 Mar 29 22:13 sessionstore-backups
-rw-rw-r--  1 rar rar     870 Mar 29 22:11 shield-preference-experiments.json
-rw-rw-r--  1 rar rar       0 Mar 29 22:13 SiteSecurityServiceState.txt
drwxr-xr-x  5 rar rar    4096 Mar 29 22:11 storage
-rw-r--r--  1 rar rar    4096 Mar 29 22:13 storage.sqlite
-rw-rw-r--  1 rar rar      50 Mar 29 22:11 times.json
-rw-r--r--  1 rar rar   98304 Mar 29 22:11 webappsstore.sqlite
-rw-------  1 rar rar     144 Mar 29 22:12 xulstore.json

/home/rar/.cache/mozilla/firefox/98jr84hq.rar
total 28
drwx------ 7 rar rar 4096 Mar 29 22:13 .
drwx------ 3 rar rar 4096 Mar 29 22:11 ..
drwx------ 4 rar rar 4096 Mar 29 22:16 cache2
drwxr-xr-x 3 rar rar 4096 Mar 29 22:11 safebrowsing
drwx------ 3 rar rar 4096 Mar 29 22:11 settings
drwxrwxr-x 2 rar rar 4096 Mar 29 22:15 startupCache
drwxr-xr-x 2 rar rar 4096 Mar 29 22:11 thumbnails

Please take a look at the attached video (context_click_abrupt_quit_issue.mp4) for the problematic case and give your comments on how to resolve this issue.


With Regards,
Rajapriya R.


On Mon, Mar 14, 2022 at 11:51 PM Rajapriya Radhakrishnan <rajapri...@gmail.com> wrote:
Hi Skupin,

It would be helpful if you give your comments ASAP.

Is the mentioned issue reproducible for you?


With Regards,
Rajapriya R.


On Tue, Mar 8, 2022 at 9:55 PM Rajapriya Radhakrishnan <rajapri...@gmail.com> wrote:
Hi Skupin,

With the python test code you shared earlier, we still observe the context click' pop up is quitting abruptly as soon as launched. Please see the attached video for the problematic case. 

Please note, initially(meaning when you shared the test code) we were able to send context click action 'n' times in a single run, but this issue is captured when testing multiple times. Before starting the test each time, I'll close and restart the browser, this is how we tested the context click case.

To run the firefox: firefox -marionette --profile /home/rar/.mozilla/firefox/9wjgl93n.port2828 --new-instance

Test sequence made in the python test script:
1. Navigate to the Linkedin signup page.
2. Send context click action to the 'Join now' button.
3. Once the menu is shown, I will try to access an item from the menu. Here, the item is 'Copy link'.
4. Then will close the context menu.
5. Finally deselect the 'Join now' button.
6. And will send release action.

Test code
import time

from marionette_driver.marionette import ActionSequence, Actions, Marionette
from marionette_driver.wait import Wait
from marionette_driver.by import By

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

for i in range(0, 5):
    touchHandler = ActionSequence(driver1, "pointer", "mouse0", {"pointerType": "mouse"})
    touchHandler.pointer_move(1350, 248).pointer_down(button=2).pause(1500).pointer_up(button=2).perform()

    def context_menu_state():
        with driver1.using_context("chrome"):
            cm_el = driver1.find_element(By.ID, "contentAreaContextMenu")
            return cm_el.get_property("state")

    Wait(driver1).until(
        lambda _: context_menu_state() == "open",
        message="Context menu did not open",
    )

    time.sleep(2)

    with driver1.using_context("chrome"):
        cm_el = driver1.find_element(By.ID, "contentAreaContextMenu")
        touchHandler1 = ActionSequence(driver1, "pointer", "mouse1", {"pointerType": "mouse"})
        touchHandler.pointer_move(0, 30, origin=cm_el).pointer_down(0).pause(1500).pointer_up(0).perform()

    time.sleep(2)

    with driver1.using_context("chrome"):
        cm_el = driver1.find_element(By.ID, "contentAreaContextMenu")
        driver1.execute_script(
            "arguments[0].hidePopup()", script_args=(cm_el,)
    )

    Wait(driver1).until(
        lambda _: context_menu_state() == "closed",
        message="Context menu did not close",
    )

    time.sleep(2)
    touchHandler.pointer_move(0,0).pointer_down().pointer_up().perform()
    time.sleep(2)

    driver1.actions.release()

driver1.delete_session()                                 


Could you please check this issue in the different runs and comment on how to resolve this issue.
context_click_abrupt_quit_issue.mp4

Rajapriya Radhakrishnan

unread,
Mar 31, 2022, 2:55:25 AM3/31/22
to Henrik Skupin, dev-we...@mozilla.org, rav...@gmail.com
Please note, I have done some changes on top of your test code in order to try some other actions like accessing menu items by sending a single tap, closing the menu by clicking outside the context menu.

Test code
!/usr/bin/env python3

import time

from marionette_driver.marionette import ActionSequence, Actions, Marionette
from marionette_driver.wait import Wait
from marionette_driver.by import By

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

for i in range(0, 2):
    def context_menu_state():
        with driver1.using_context("chrome"):
            cm_el = driver1.find_element(By.ID, "contentAreaContextMenu")
            return cm_el.get_property("state")

    touchHandler = ActionSequence(driver1, "pointer", "dev_mouse0", {"pointerType": "mouse"})
    touchHandler.pointer_move(1350, 248).pointer_down(button=2).pause(1500).pointer_up(button=2).perform()

    Wait(driver1).until(
        lambda _: context_menu_state() == "open",
        message="Context menu did not open",
    )

    time.sleep(2)

    with driver1.using_context("chrome"):
        cm_el = driver1.find_element(By.ID, "contentAreaContextMenu")
        touchHandler.pointer_move(0, 20, origin=cm_el).pointer_down(0).pause(1500).pointer_up(0).perform()

    time.sleep(2)

    with driver1.using_context("chrome"):
        cm_el = driver1.find_element(By.ID, "contentAreaContextMenu")
        driver1.execute_script(
            "arguments[0].hidePopup()", script_args=(cm_el,)
    )

    Wait(driver1).until(
        lambda _: context_menu_state() == "closed",
        message="Context menu did not close",
    )

    time.sleep(2)
    touchHandler.pointer_move(0,0).pointer_down().pointer_up().perform()
    time.sleep(2)

    driver1.actions.release()


I'm not sure this issue is to be checked on the web driver side or browser side, if it is browser side, please let me know where I can escalate this issue further. I spent almost a month on this issue and couldn't find the cause of this issue, so I'm expecting your prompt response.

Julian Descottes

unread,
May 31, 2022, 7:54:17 AM5/31/22
to dev-we...@mozilla.org, rajapri...@gmail.com, dev-we...@mozilla.org, rav...@gmail.com, Henrik Skupin
Hi,

The test script uses `pointer_down(button=2).pause(1500).pointer_up(button=2).perform()`, probably to trigger the context menu to open?
Could you try to reduce the delay from 1500 to 500 or less?

If I manually try to open a context menu and I wait for too long between my mousedown and my mouseup, the contextmenu disappears on mouseup.
Maybe 1500ms is too slow for the right click to correctly register? Worth checking, in the meantime I'll give a try to your test script.

Thanks

Rajapriya Radhakrishnan

unread,
May 31, 2022, 8:14:01 AM5/31/22
to dev-we...@mozilla.org, jdesc...@mozilla.com, rajapri...@gmail.com, dev-we...@mozilla.org, rav...@gmail.com, hsk...@mozilla.com
switching to my new mail id rajapr...@gmail.com because of some log-in issues with my existing email id - rajapri...@gmail.com.

Rajapriya Radhakrishnan

unread,
May 31, 2022, 8:38:40 AM5/31/22
to dev-we...@mozilla.org, jdesc...@mozilla.com, dev-we...@mozilla.org, rav...@gmail.com, hsk...@mozilla.com
Ok. I will check with the reduced delay first.

Julian Descottes

unread,
May 31, 2022, 9:14:42 AM5/31/22
to dev-we...@mozilla.org, rajapr...@gmail.com, Julian Descottes, dev-we...@mozilla.org, rav...@gmail.com, Henrik Skupin
For what it's worth, I tested the provided script both on macos and windows 10, with various delays and I've not been able to reproduce your issue.
Overall, "chrome" context is not specified and we can only offer limited support for this.
It seems we can't isolate the problem you are facing, so it would probably be better to find a way to execute your task without having to use "chrome" context.

Rajapriya Radhakrishnan

unread,
May 31, 2022, 3:14:32 PM5/31/22
to dev-we...@mozilla.org, jdesc...@mozilla.com, dev-we...@mozilla.org, rav...@gmail.com, hsk...@mozilla.com
  Hi @jdescottes,

Could you please share the test sequence you tried? So, I will try in the same way and update you.

I reproduced the issue in the below way.

Step-1: Start the browser by giving this command: 
                       # firefox -marionette --profile /home/rar/.mozilla/firefox/z6vhfn1p.port2828 --new-instance

            When we create profiles explicitly, the following directories are created, I set the first path while launching the browser.
                       /home/rar/.mozilla/firefox/z6vhfn1p.port2828
                       /home/rar/.cache/mozilla/firefox/z6vhfn1p.port2828

Step-2: Run the test script.

Step-3: Once the execution is done, I will close the browser by hitting 'Ctrl+C' in the firefox' terminal.

When I tested multiple times on the Ubuntu system, the issue was observed. Any delay is required to relaunch the browser? or Time sync is needed between the browser launch and the test execution (mean marionette initialization)?

Meanwhile I capture the video of the problematic case again and upload it here.


Regards,
Rajapriya
Reply all
Reply to author
Forward
0 new messages