This project is read-only.

Slow startup and object names with spaces

Mar 3, 2013 at 6:14 PM
Hi all

First of all I want to thank you for Cobra LDTP.

I have two question:

1) The ldtp module takes about 8 seconds to load (after that time my script starts). Is it normal? I've tested this on Windows 7 and 8 (both 32 bit and both with dual core 2.2GHz and 4GB of Ram).

2) If I use the getobjectlist function (or other similar functions) then I get all object name, but those names are withot spaces. For example, if an object name is "Some Menu Title" I see "SomeMenuTitle". I researched a bit and found that it is a behavior of LDTP. Can I solve this "problem" and get names with spaces?

Thank you so much
Mar 5, 2013 at 11:34 PM
Hello, Good to know your interest on Cobra :-)
Ans 1: I could not figure out the delay, even on my development box, I see the delay, but all other test system we have in our lab doesn't have the issue, not sure whats the issue. But I never faced any issue on Windows 8. I'm using Active State Python 2.7, just incase.
Ans 2: You can get them from getobjectproperty('window name', 'object name', 'label')
Mar 7, 2013 at 12:09 AM
Edited Mar 7, 2013 at 12:14 AM

I did a little script to check the delay:

import time
t0 = time.time()
from ldtp import *
print "ldtp import time:",time.time() - t0,"sec."

The result is: "ldtp import time: 8.53200006485 sec."

This happens on both my machines...

I will try to understand what happens. If I'll find out the problem I'll let you know.

The getobjectproperty works like a charm.

Probably I'll ask you something else :)

Thank you very much.

EDIT: I use python 2.7 for windows but I download it from the official site... I will try the ActiveState version.
Mar 7, 2013 at 1:01 AM
Hi Amstaff,

I commented the following line in ldtp/

d[local_name].doc = client._client.system.methodHelp(method)

and things were pretty fast. Can you please confirm ? so that I can commit this to head. This API is not useful, so it doesn't hurt the functionality.

Mar 7, 2013 at 12:15 PM
Edited Mar 7, 2013 at 2:45 PM
I commented that line. Now the import is a little bit faster. The delay is about 7.3 seconds.

I also tried Active State Python but the delay is the same.

Mar 7, 2013 at 8:40 PM
Not sure, whats going wrong in your environment then. I have Windows 7 SP1 Enterprise / Windows 7 SP1 Ultimate, also Windows 8 Professional, I don't find any issues with them. If you get a chance, please debug further and let me know the possible issue. Thanks