Bug 511193 - FileDialog: do click action for 'Details' menu item crash the application
Summary: FileDialog: do click action for 'Details' menu item crash the application
Status: REOPENED
Alias: None
Product: UI Automation
Classification: Mono
Component: Winforms - General (show other bugs)
Version: Release 1.0
Hardware: x86 openSUSE 11.1
: P2 - High : Critical
Target Milestone: ---
Assignee: E-mail List
QA Contact: Michael Gorse
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-09 10:01 UTC by calen chen
Modified: 2009-10-28 20:09 UTC (History)
1 user (show)

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


Attachments
python script to run click action (988 bytes, text/x-python)
2009-06-09 10:02 UTC, calen chen
Details
crash exception (78.50 KB, application/octet-stream)
2009-06-09 10:02 UTC, calen chen
Details
new python script (1.01 KB, text/x-python)
2009-07-14 03:09 UTC, calen chen
Details
python script that works on my machine (655 bytes, text/plain)
2009-07-14 19:35 UTC, Andres Aragoneses
Details

Note You need to log in before you can comment on or make changes to this bug.
Description calen chen 2009-06-09 10:01:15 UTC
REPRO:

1. run uia2atk/test/samples/savefiledialog.py, click 'Click me' to invoke 'Save As' dialog
2. run the attachment python script, which perform 'click' action for view style dropdown toggle button from toolbar on the top right side, and perform 'click' action for 'Details' menu_item
3. wait some minutes(

RESULTS:

the application is crashed(please see the exception from attachment)

EXPECTED RESULTS:

"Details" menu_item should be selected when doing click action, TableCells list is showing with detail view style
Comment 1 calen chen 2009-06-09 10:02:10 UTC
Created attachment 296898 [details]
python script to run click action
Comment 2 calen chen 2009-06-09 10:02:45 UTC
Created attachment 296899 [details]
crash exception
Comment 3 Andres Aragoneses 2009-07-07 14:52:36 UTC
(In reply to comment #0)
> REPRO:
> 
> 1. run uia2atk/test/samples/savefiledialog.py, click 'Click me' to invoke 'Save
> As' dialog
> 2. run the attachment python script, which perform 'click' action for view
> style dropdown toggle button from toolbar on the top right side, and perform
> 'click' action for 'Details' menu_item

I guess you're missing a step between 1 and 2, which is "click on the 'click me' button", right? Otherwise I get this python exception when running the script:

Traceback (most recent call last):
  File "script4bug.py", line 15, in <module>
    toggle_button = pyatspi.findDescendant(save_dialog, lambda x: x.name == '' and x.getRoleName() == 'toggle button')
  File "/usr/lib/python2.5/site-packages/pyatspi/utils.py", line 173, in findDescendant
    for child in acc:
TypeError: 'NoneType' object is not iterable


> 3. wait some minutes(

How many minutes? I've waited 10 and I didn't get the exception.

Anyway, there's a chance that a recent commit did also fix this, because the exception mentions "HandlePossiblePreExistingProvider", and the fix in r137460 (trunk) prevents this to happen in a lot of situations. So I'm marking this as FIXED. Please check, and mark as VERIFIED accordingly. Thanks!
Comment 4 Feng Xia Mu 2009-07-13 03:17:18 UTC
I run the script on  two computer 7 times, and every time the script can get the menu item's states correctly, and do the same action on GUI, also can't crash the app. 

the output on the console:
[menu item | Small Icon]: [STATE_ENABLED, STATE_FOCUSABLE, STATE_SELECTABLE, STATE_SENSITIVE, STATE_SHOWING, STATE_VISIBLE]
[menu item | Tiles]: [STATE_ENABLED, STATE_FOCUSABLE, STATE_SELECTABLE, STATE_SENSITIVE, STATE_SHOWING, STATE_VISIBLE]
[menu item | Large Icon]: [STATE_ENABLED, STATE_FOCUSABLE, STATE_SELECTABLE, STATE_SENSITIVE, STATE_SHOWING, STATE_VISIBLE]
[menu item | List]: [STATE_ENABLED, STATE_FOCUSABLE, STATE_SELECTABLE, STATE_SENSITIVE, STATE_SHOWING, STATE_VISIBLE]
[menu item | Details]: [STATE_ENABLED, STATE_FOCUSABLE, STATE_SELECTABLE, STATE_SENSITIVE, STATE_SHOWING, STATE_VISIBLE]

I will mark it as invalid.
Comment 5 calen chen 2009-07-13 04:02:33 UTC
Hi Andres, Sorry I need reopen this bug for you because we still can reproduce it in both Felicia and my machines, I will try to describe it clearly :)

REPRO:
1. run uia2atk/test/samples/savefiledialog.py, 
2. on GUI, click 'Click me' to invoke 'Save As' dialog, (btw,I have mentioned this step in original REPRO)
3. run the new attachment python script, which perform 'click' action for view
style dropdown toggle button from toolbar on the top right side, and perform
'click' action for 'Details' menu_item, and will print "click Detail to change view style"
4. after step 3 is finished, back to GUI, you will see TreeTable is refreshed but not completely that still have many cells are missing with blank empty
5. click the TreeTable

RESULTS:

like mentioned in step4, after click the TreeTable that the application is crashed

EXPECTED RESULTS:

after perform 'click' action for 'Detail' that cells in the TreeTable should be refreshed quickly and doesn't crash the application

COMMENTS:


Verify in rpm version:
mono-uia-132785-276
uiautomationwinforms-137705-679
uiaatkbridge-137705-670
Comment 6 Feng Xia Mu 2009-07-13 05:24:34 UTC
I agree with Calen if add the step 5, the GUI will crash, but on my computer the TreeTable never be refreshed.
Comment 7 Andres Aragoneses 2009-07-13 19:59:30 UTC
(In reply to comment #5)
> 2. on GUI, click 'Click me' to invoke 'Save As' dialog, (btw,I have mentioned
> this step in original 

You're right Calen, sorry that I mislooked it.


However, I'm having a hard time trying to reproduce this one. For some reason, findDescendant calls get blocked sometimes, and this makes me unable to reproduce the issue with the script attached.

I've tried to convert the python script to an Accerciser's IPythonConsole script:

import time;acc.getChildAtIndex(1).getChildAtIndex(0).getChildAtIndex(3).getChildAtIndex(1).queryAction().doAction(0);time.sleep(4);acc.getChildAtIndex(2).getChildAtIndex(0).getChildAtIndex(4).queryAction().doAction(0)


But for some reason, it doesn't work either (with this at least I get the details dropdown shown, but it doesn't manage to select the last option :( )

Can you figure out another way to do this?
Comment 8 calen chen 2009-07-14 03:09:08 UTC
Created attachment 304865 [details]
new python script

Ipython doesn't work for me too, it return False when doing click action for menu_item in window.

I update my python script to remove 'name' judgement from finding 'toggle button', I assume if because of the wrong 'name'. Please follow the REPRO in Comment #5 to run the new attachment script, if the script doesn't doing click action for 'Detail' menu_item, you can close the dialog and click 'Click me' to open the dialog again, then rerun the script(I am not sure why sometimes click action doesn't work for menu_item, and this issue is not reproduce each time).
Comment 9 Andres Aragoneses 2009-07-14 19:35:37 UTC
Created attachment 305073 [details]
python script that works on my machine

Ok, managed to create a python script that works for me, with the following modifications:

1) Use True as a third parameter to the function findDescendant(), at least to find the child "ipy", because it's faster (it does a non-depth-first order search). This is a general recommendation for all your python scripts.

2) Don't use findDescendant() when looking for elements inside ipy. This is a bit hacky and is not recommended for your scripts, just for people who have problems with findDescendant().