Object Oriented LDTP bundled with LDTP package

With this implementation, the code can be like

Approach 1

from ooldtp import *

gedit = context ('*-gedit')
btnFind = gedit.getchild ('btnFind')
btnFind.click ()

Approach 2

from ooldtp import *

gedit = context ('*-gedit')
gedit.click ('btnFind')

Welcome to Object-Oriented LDTP (EXPERIMENTAL) by Palm Source

What it is Object-Oriented LDTP?

Till now LDTP supports this kind of syntax:

click('*gedit', btncopy)
selectmenuitem('*gedit', 'mnuFile;mnuOpen')

it does not support appmap anymore. however I prefer using appmap to maximize its maintainability of our automation script. and I want ldtp have ability to using the following syntax to write script:




so I write a wrapper for LDTP, it wraps/improves most of LDTP API.

How to use?

use convert.py to generate the window declaration

  • cmd line:
    • convert windowname output e.g.
    • convert frm*gedit geditclass.py it will generate geditclass.py

open the file, you can find the code looks like below:

from window import *

class Gedit(Window):
    name = '*gedit'

    btncopy = Window.PushButton('btncopy', name)
    btncut = Window.PushButton('btncut', name)
    btnfind = Window.PushButton('btnfind', name)
    btnfindandreplace = Window.PushButton('btnfindandreplace', name)
    btngtkundo = Window.PushButton('btngtk-undo', name)

    mnuAbout = Window.MenuItem('mnuHelp;mnuAbout', name)
    mnuAda = Window.MenuItem('mnuView;mnuHighlightMode;mnuSources;mnuAda', name)
    mnuAllLowerCase = Window.MenuItem('mnuEdit;mnuChangeCase;mnuAllLowerCase', name)
    mnuAllUpperCase = Window.MenuItem('mnuEdit;mnuChangeCase;mnuAllUpperCase', name)
    # ...
frmGedit = Gedit()

now you can do something like this

To select a menuitem:

or write this

To click a button:

or write this

You can find more wrapped APIs in window.py

also you can add your own methods to this class.

That's all, enjoy it ;)

Found any bug please email me: