GNOME Bugzilla – Bug 574111
unable to select a menu item
Last modified: 2009-03-17 19:39:48 UTC
Please describe the problem: In the user interface of anjuta, there is a menuitem 'File->New' . There is also a menu 'File->New'. The submenu 'File->New' has a menuitem 'File->New->2.File' . The issue is that I am unable to select the menuitem 'File->New->2.File' . The command ldtp.selectmenuitem('frm*Anjuta*', 'mnuFile;mnuNew;mnu2.File') actually selects 'File->New'. This isn't the desired behavior. The script given it 'Steps to reproduce' demonstrates this. Steps to reproduce: #!/usr/bin/env python from ldtp import * program_name = 'anjuta' window_title = 'frm*Anjuta*' appundertest(program_name) launchapp(program_name) waittillguiexist(window_title) selectmenuitem(window_title, 'mnuFile;mnuNew;mnu2.File') Actual results: The wrong menuitem 'File->New' is selected, in lieu of the expected menuitem 'File->New->2.File' Expected results: Menuitem 'File->New->2.File' to be selected. Does this happen every time? Yes. Other information:
Hi Sandro, Lately try your case. Then in the convection of LDTP, changing your scripts to ldtp.selectmenuitem('frm*Anjuta*', 'mnuFile;mnuNew1;mnu2.File') will do. This is a not a bug, though a better LDTP-name-convection could be considered. Suggest close this one : )
Ok, it works :) Closing the bug... Cheers.
However... We are mixing two naming schemes here. The naming schemes where we use names that the widgets are providing, and the naming scheme where it is LDTP that provides the name for the widget. mnuNew1 is a name that is dynamically created by LDTP, and LDTP could perfectly call another widget by this name in some other configuration of Anjuta. Anjuta loads plugins dynamically, those plugins are able to alter the user interface. By using mnuNew1 in 'mnuFile;mnuNew1;mnu2.File' I am introducing undeterminism in the "statement". So even though 'mnuFile;mnuNew1;mnu2.File' does actually works. It is never the less hiding a "Phase of moon bug". http://en.wikipedia.org/wiki/Unusual_software_bug