Nagappan,<br><br>I agree with Ara. Personally, I feel it is always more comfortable to address any menu in the full hierarchy. The  &#39;mnuCloseAll1&#39; tip you give is working. But it requires a bit of logic from user&#39;s code to follow LDTP&#39;s naming convention on the anonymous objects. But for menu, full hierarchy is already a simple solution to avoid the name collision in sub-menus in UI design.<br>

<br>Thanks for the help.<br>Scott<br><br><div class="gmail_quote">On Thu, Oct 15, 2009 at 2:23 PM, Ara Pulido <span dir="ltr">&lt;<a href="mailto:ara@ubuntu.com">ara@ubuntu.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hello all,<br>
<br>
I&#39;ve always found the way LDTP deals with menus a bit weird.<br>
<br>
I think it is much better if all the functions dealing with menus would use some kind of hierarchy. Or better, if it could be set in the parameters:<br>
<br>
ldtp.doesmenuitemexist(windows_name, &quot;mnuFile;mnuCloseAll&quot;, hierarchy=true)<br>
<br>
ldtp.doesmenuitemexist(windows_name, &quot;mnuCloseAll&quot;, hierarchy=false)<br>
<br>
One question for LDTPv2, would this inconsistencies be solved? Would be ooldtp be better in LDTPv2?<br>
<br>
Thanks,<br>
Ara.<div class="im"><br>
<br>
On 14/10/09 17:00, Nagappan Alagappan wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
Hi Scott,<br>
<br>
On Wed, Oct 14, 2009 at 4:02 AM, Wang Qi, Scott &lt;<a href="mailto:wangqi.s@gmail.com" target="_blank">wangqi.s@gmail.com</a><br></div><div><div></div><div class="h5">
&lt;mailto:<a href="mailto:wangqi.s@gmail.com" target="_blank">wangqi.s@gmail.com</a>&gt;&gt; wrote:<br>
<br>
    Hi Nagappan,<br>
<br>
    I saw some inconsistency in the parameter when calling these two<br>
    functions : hasstate () and doesmenuitemexist().<br>
<br>
    1) ldtp.doesmenuitemexist(windows_name, &#39;mnuFile;mnuCloseAll&#39;)<br>
<br>
    doesmenuitemexist () requires the full path which is the<br>
    &#39;mnuFile;mnuCloseAll&#39; menu.<br>
<br>
    2) ldtp.hasstate(windows_name, &#39;mnuCloseAll&#39;, ldtp.state.SENSITIVE)<br>
<br>
    hasstate () only requires the last node which is &#39;mnuCloseAll&#39;.<br>
<br>
    Is this design deliberately as this?<br>
<br>
<br>
hasstate is a general function, which works for all object type. To work<br>
with menu, we have to follow the hierarchy. If its a requirement we can<br>
implement it on LDTPv2.<br>
<br>
<br>
<br>
    The second question is that if 2 root menus has a  submenu with the<br>
    same name for example, &#39;mnuFile;mnuCloseAll&#39; and<br>
    &#39;mnuProject;mnuCloseAll&#39;. How ldtp.hasstate() will return the status<br>
    with input of &#39;mnuCloseAll&#39;? Will it only return the first found mnu<br>
    named &quot;mnuCloseAll&quot;?  I did a simple experiment. It seems it indeed<br>
    returns the attribute for the first mnu. So how to get the attribute<br>
    for the 2nd sub menu item.<br>
<br>
<br>
&#39;mnuCloseAll1&#39; should return the state of it :)<br>
<br>
Thanks<br>
Nagappan<br>
<br>
<br>
    Thanks<br>
    Scott<br>
<br>
<br>
<br>
<br>
    _______________________________________________<br>
    LDTP-dev mailing list<br></div></div>
    <a href="mailto:LDTP-dev@lists.freedesktop.org" target="_blank">LDTP-dev@lists.freedesktop.org</a> &lt;mailto:<a href="mailto:LDTP-dev@lists.freedesktop.org" target="_blank">LDTP-dev@lists.freedesktop.org</a>&gt;<div class="im">

<br>
    <a href="http://lists.freedesktop.org/mailman/listinfo/ldtp-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/ldtp-dev</a><br>
<br>
<br>
<br>
<br>
--<br>
Linux Desktop (GUI Application) Testing Project -<br>
<a href="http://ldtp.freedesktop.org" target="_blank">http://ldtp.freedesktop.org</a><br>
<a href="http://nagappanal.blogspot.com" target="_blank">http://nagappanal.blogspot.com</a><br>
<br>
<br>
<br>
_______________________________________________<br>
LDTP-dev mailing list<br>
<a href="mailto:LDTP-dev@lists.freedesktop.org" target="_blank">LDTP-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/ldtp-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/ldtp-dev</a><br>
</div></blockquote>
<br>
</blockquote></div><br>