[LDTP-Dev] Way to distinguish between menu items

Ara Pulido ara at ubuntu.com
Tue Jul 28 23:31:27 PDT 2009


Hey Nagappan, thanks for your reply.

This is a possible solution, but not the best one.
It does not assure that the menu comes from the embedded component. It 
may well be that there are two menus with that name.

It'll be nice to have an extra parameter in the doesmenuexist(window, 
hierarchy, strictHierarchy=False) that searches for a strict hierarchy 
of menus.

If not for LDTP 1.x, at least for LDTP 2

Filling a wishlist bug now.

Cheers,
Ara.

Nagappan Alagappan wrote:
> Hi Ara,
>
> When I tried with Pidgin, I noticed the first menu item (which is in 
> default system menu) was listed as 'mnuPidginInternetMessenger' and 
> the one under indicator-applet is displayed as 
> 'mnuPidginInternetMessenger1', is that fine ?
>
> So, you can use them as:
>
> doesmenuitemexist('frmTopExpandedEdgePanel', 'mnuPidginInternetMessenger')
> doesmenuitemexist('frmTopExpandedEdgePanel', 
> 'mnuPidginInternetMessenger1')
>
> Drawback here is, you will not be able to use with hierarchy.
>
> Thanks
> Nagappan
>
> On Tue, Jul 28, 2009 at 5:01 AM, Ara Pulido <ara at ubuntu.com 
> <mailto:ara at ubuntu.com>> wrote:
>
>     Hello all,
>
>     I am trying to write a test to check that if a menu item exists or not
>     in the top panel. The problem is that the name is exactly the same
>     that
>     another one in the top panel that always exists.
>
>     This is the structure:
>
>     First match (always there):
>
>     TOP PANEL
>     -----> Applications
>     ------------> Internet
>     -------------------> Evolution Mail
>
>
>     Second match (not always there and the one we want to check in the
>     test):
>
>     TOP PANEL
>     ------> Embedded componet (embindicator-applet)
>     ---------------> Evolution Mail
>
>
>     The problem is that using doesmenuitemexists always returns 1, because
>     it matches with the first one.
>
>     Using invokemenu does not help, as it invokes the context menu of the
>     embedded component, not the normal menu.
>
>     Any ideas how to make this difference?
>
>     Thanks,
>     Ara.
>
>     _______________________________________________
>     LDTP-dev mailing list
>     LDTP-dev at lists.freedesktop.org <mailto:LDTP-dev at lists.freedesktop.org>
>     http://lists.freedesktop.org/mailman/listinfo/ldtp-dev
>
>
>
>
> -- 
> Linux Desktop (GUI Application) Testing Project - 
> http://ldtp.freedesktop.org
> http://nagappanal.blogspot.com



More information about the LDTP-dev mailing list