Bug 503973

Summary: pyatspi.generateMouseEvent does not open menu when application window is active
Product: [Mono] UI Automation Reporter: Brian Merrell <bgmerrell>
Component: Winforms - GeneralAssignee: E-mail List <mono-a11y-bugs>
Status: NEW --- QA Contact: E-mail List <mono-a11y-qa>
Severity: Normal    
Priority: P3 - Medium CC: cachen
Version: Release 1.0   
Target Milestone: ---   
Hardware: x86   
OS: openSUSE 11.1   
Whiteboard:
Found By: Integration Test Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: pyatspi script referenced in REPRO steps

Description Brian Merrell 2009-05-14 17:29:21 UTC
PROBLEM STATEMENT

The pyatspi.generateMouseEvent method is used to simulate a mouse click on an accessible control.  The problem is that when the method is used to simulate a left mouse click on a menu, that menu does not open if the application window is active.  If another application window is active when the generateMouseEvent method is issued, the application window that contains the menu being clicked becomes active and the menu opens.

REPRO

1.  Run uia2atk/test/samples/toolstripmenuitem.py
2.  Run the attached pyatspi script from another terminal on the desktop , which does the following:
    1.  Findd the "Edit" menu of the above application
    2.  Prompts you to click on the toolstripmenuitem.py title bar (do this)
    2.  Uses pyatspi.generateMouseEvent to left click on the "Edit" menu

RESULTS

The "Edit" menu is selected, but does not open

EXPECTED RESULTS

The "Edit" menu should open

COMMANDS

This smells like it could be something that needs to be handled upstream.

If you want to see the desired behavior, you can simply ignore the attached pyatspi script's request to click on the toolstripmenuitem.py title bar.  This will cause the terminal from which the script is running to remain active while the toolstripmenuitem.py application window is inactive.
Comment 1 Brian Merrell 2009-05-14 17:30:45 UTC
Created attachment 292259 [details]
pyatspi script referenced in REPRO steps
Comment 2 Brian Merrell 2009-05-14 22:29:08 UTC
This is true for menus of ToolStrips and MenuStrips, at least.
Comment 3 Ray Wang 2009-05-15 01:54:42 UTC
seems like this bug works for me. 
just want to add me in the CC list :)
Comment 4 Brian Merrell 2009-05-15 02:29:50 UTC
(In reply to comment #3)
> seems like this bug works for me. 
> just want to add me in the CC list :)

<@bgmerrell> ray: hey, about bug 503973, did your comment mean that you 
             can duplicate it or that you cannot duplicate it?
<@ray> bgmerrell, I have tried the bug, but I can't reproduce it :) 
<@bgmerrell> ray: what distro/version?  what version of GNOME?
<@ray> bgmerrell, opensuse 11.1 32bit, gnome 2.24
<@ray> bgmerrell, maybe i missed something
<@bgmerrell> interesting.  i was using the same thing 
<@bgmerrell> ray: are you using a VM? 
<@ray> bgmerrell, no
<@bgmerrell> ray: ugh.. maybe this is just like that other 
             generateMouseEvent bug
<@bgmerrell> https://bugzilla.novell.com/show_bug.cgi?id=450704
<@ray> bgmerrell, I run the sample script, then run the test script, no 
       matter what window is active, the "Edit" menu pops up finally
Comment 5 Brian Merrell 2009-05-15 04:11:54 UTC
More relevant IRC discussion:

<@bgmerrell> calen: could you try to reproduce it?
<@calen> bgmerrell, hello
<@calen> bgmerrell, ok, i will try
<@calen> bgmerrell, I also can't reproduce it! Edit menu is opened.
<@felicia> hi bgmerrell, bug 503973 can  reproduced on my computer
<@felicia> Edit menu is not opened, uiaatkbridge-134036-662
<@ray> bgmerrell, interesting, Calen and I can't duplicate it, felicia 
       and you can :)
<@bgmerrell> are calen and felicia using VMs?
<@felicia> I ‘ m not using VMs
<@calen> bgmerrell, not VM,