Bug 503973 - pyatspi.generateMouseEvent does not open menu when application window is active
Summary: pyatspi.generateMouseEvent does not open menu when application window is active
Status: NEW
Alias: None
Product: UI Automation
Classification: Mono
Component: Winforms - General (show other bugs)
Version: Release 1.0
Hardware: x86 openSUSE 11.1
: P3 - Medium : Normal
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-14 17:29 UTC by Brian Merrell
Modified: 2009-07-02 03:45 UTC (History)
1 user (show)

See Also:
Found By: Integration Test
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
pyatspi script referenced in REPRO steps (641 bytes, text/plain)
2009-05-14 17:30 UTC, Brian Merrell
Details

Note You need to log in before you can comment on or make changes to this bug.
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,