[LDTP-Dev] Upgraded Script for generate map in testing.

Guofu Xu Guofu.Xu at palmsource.com
Tue Jul 4 05:47:05 PDT 2006


Hi all,

I've upgraded a new way to generate the map for it. Which is the better
way, need to confirm from you :)

see below for difference (two positions).

This script (generatemap.py) intends to help new staff how to recognize
the control and use it for testing.

For newbie on LDTP, they usually dont know whatever the control should
be used in their script. after use this way which 
generated by generatemap.py script, Hope this way will helpful.

That script applies to setup their parameters that has need a tag
control in API, if any control is changed, just revise
the tag in that generated script, I think this way should be easy
maintained in automation test.


Script Usuags:
	python generatemap.py *gedit framegedit.py


The output format of framegedit.py (see attachment)
Old Format
--------------------------------------------------------------------
#!/usr/bin/python

sepsym = ";"

def mnuAutocheckSpelling(parent = "mnuTools"):
	tag = "mnuAutocheckSpelling"
	if parent != "None":
		tag = eval(parent)() + sepsym + tag
	return tag

def lbl(parent = "None"):
	tag = "lbl"
	if parent != "None":
		tag = eval(parent)() + sepsym + tag
	return tag
New
format------------------------------------------------------------------
--

#!/usr/bin/python

sepsym = ";"

class lbl(object):
	tag = "lbl"
	if str(object).find("object") == -1:
		tag = object().tag + sepsym + tag

class mnuEdit(object):
	tag = "mnuEdit"
	if str(object).find("object") == -1:
		tag = object().tag + sepsym + tag

class lblDocuments(object):
	tag = "lblDocuments"
	if str(object).find("object") == -1:
		tag = object().tag + sepsym + tag

class tchDocuments(object):
	tag = "tchDocuments"
	if str(object).find("object") == -1:
		tag = object().tag + sepsym + tag


So, use this file framegedit.py, they can use like (in your scripts):
	import ldtp
	import framegedit

Old
format------------------------------------------------------------------
--
	ldtp.selectmenuitem(framegedit.frmgedit(), framegedit.mnuOpen())
New
format------------------------------------------------------------------
--
	ldtp.selectmenuitem(framegedit.frmgedit.tag,
framegedit.mnuOpen.tag)

and, if any tag name of control is changed, it just need to sync
framegedit.py with that.

Note: In this case, to use python2.5a which has a autocomlete feature,
all of this rather easy do.
	when you entry the symbol '.'(after the ldtp or frmagedit), then
hit a tab keyboad, you can see all of tag list in popup window


Please let me know if you have any questions or need more information.

Best Regards!
 
MSN:   lavixu at hotmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: framegedit.py
Type: application/octet-stream
Size: 20671 bytes
Desc: framegedit.py
Url : http://lists.freedesktop.org/archives/ldtp-dev/attachments/20060704/95da0017/framegedit-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generatemap.py
Type: application/octet-stream
Size: 4856 bytes
Desc: generatemap.py
Url : http://lists.freedesktop.org/archives/ldtp-dev/attachments/20060704/95da0017/generatemap-0001.obj


More information about the LDTP-dev mailing list