[LDTP-Dev] Simple python script is not working

Nagappan anagappan at novell.com
Fri Oct 21 23:03:30 PDT 2005


Hi Mauricio,
    API Reference page is updated periodically. listsubmenus function 
has been implemented, but currently it does not return anything... We 
will do it soon. Thanks for your interest :)

Thanks
Nagappan

Mauricio Lin wrote:
> Hi all,
>
> Is API reference from 
> http://gnomebangalore.org/ldtp/index.php/API_Reference updated?
>
> I found listsubmenus function but it is not implemented yet, right?
>
> BR,
>
> Mauricio Lin.
>
> On 10/21/05, *Mauricio Lin* <mauriciolin at gmail.com 
> <mailto:mauriciolin at gmail.com>> wrote:
>
>     Hi Shaheed,
>
>     I solved the problem.
>
>     I put a time.sleep() between the two actions as below:
>
>     selectmenuitem ('frmUnsavedDocument1-gedit', 'mnuFile;mnuOpen')
>     time.sleep(2)
>     click('dlgOpenFile', 'btnCancel')
>
>     It was a kind of sync problem.
>
>     BR,
>
>     Mauricio Lin.
>
>     On 10/21/05, *Mauricio Lin* < mauriciolin at gmail.com
>     <mailto:mauriciolin at gmail.com>> wrote:
>
>         I also removed the "..." dots from [dlgOpenFile...], but the
>         error keeps happening.
>
>
>         On 10/21/05, *Mauricio Lin * < mauriciolin at gmail.com
>         <mailto:mauriciolin at gmail.com>> wrote:
>
>             Hi Shaheed,
>
>             The selectmenuitem is working now. Thanks.
>
>             I have followed the new "How to write test scripts in
>             python" and another similar error is happening. See below:
>
>             Traceback (most recent call last):
>               File "simple.py", line 13, in ?
>                 click('dlgOpenFile', 'btnCancel')
>             ldtp.error: Unable to get gui handle ldtp.c 494
>
>             The gedit.map that show the dlgOpenFile is:
>             [dlgOpenFile...]
>             dlgOpenFile={class=dialog,parent=gedit,child_index=1,label=Open
>             File...}
>             flr0={class=filler,parent=dlgOpenFile,child_index=0}
>             ...
>             btnOpen={class=push_button,parent=flr13,child_index=0,label=Open}
>             btnCancel={class=push_button,parent=flr13,child_index=1,label=Cancel}
>
>             The script is:
>
>             initappmap('/home/mauricio/teste/gedit.map')
>
>             launchapp('gedit')
>
>             selectmenuitem ('frmUnsavedDocument1-gedit',
>             'mnuFile;mnuOpen')
>
>             guiexist ('dlgOpenFile')
>
>             click('dlgOpenFile', 'btnCancel')
>
>             BR,
>
>             Mauricio Lin.
>
>
>             On 10/21/05, *Shaheed Shaik* <sshaik at novell.com
>             <mailto:sshaik at novell.com>> wrote:
>
>                 Hi Mauricio,
>
>                 Check whether the window name you passed to
>                 'selectmenuitem' or 'click'
>                 is matching with the one in your 'gedit.map', if you
>                 are using latest
>                 appmap module, it would have been generated as
>                 'frmUnsavedDocument1-gedit'. If that is the case, your
>                 selectmenuitem
>                 should be as follows,
>                 selectmenuitem ('frmUnsavedDocument1-gedit',
>                 'mnuFile;mnuOpen').
>
>                 Also cross check whether the accessibility is enabled
>                 or not.
>
>                 Cheers,
>                 Shaheed.
>
>                 >>> Mauricio Lin < mauriciolin at gmail.com
>                 <mailto:mauriciolin at gmail.com>> 10/20/05 8:37 pm >>>
>                 Hi all,
>
>                 I have followed the instruction from
>                 http://gnomebangalore.org/ldtp/index.php/How_to_create_Test_Scripts_for_PY-
>                 LDTPin
>                 order to create my simple script, but it is not working.
>
>                 The error message is printed as follow:
>
>                 Traceback (most recent call last):
>                 File "teste.py", line 9, in ?
>                 selectmenuitem ('gedit', 'mnuFile;mnuOpen')
>                 ldtp.error: Unable to get gui handle ldtp.c 1236
>
>                 This happens after I execute the python script.
>
>                 **************************************************************
>
>                 from ldtp import *
>                 from ldtputils import *
>                 import sys, string
>
>                 initappmap('/home/mauricio/teste/gedit.map')
>
>                 launchapp('gedit')
>
>                 selectmenuitem ('gedit', 'mnuFile;mnuOpen')
>
>                 click ('gedit', 'btnOpen')
>                 **************************************************************
>
>                 Any idea?
>
>                 BR,
>
>                 Mauricio Lin.
>
>
>
>
>

-- 
Nagappan A <anagappan at novell.com>
Novell Software Development (I) Pvt. Ltd.
Linux Desktop Testing Project - http://gnomebangalore.org/ldtp/index.php/Main_Page
http://nagappanal.blogspot.com/



More information about the Ldtp-dev mailing list