GNOME Bugzilla – Bug 381899
stateenabled function doesn't work
Last modified: 2006-12-04 07:04:15 UTC
Please describe the problem: the stateenabled function is used to find if an object is enabled in a window. When used, this function gives the following error : stateenabled('*gedit','btnPrint') Traceback (most recent call last):
+ Trace 91282
_message = generatexml (command.STATENEABLED, _requestId, windowName, componentName)
Steps to reproduce: 1. open python shell 2. enter from ldtp import * 3. then enter stateenabled('<some-win-name>','<some-button>') .. i used *gedit as window name and btnPrint for the component Actual results: Expected results: 1 or 0 depending on the state of the object (disabled or enabled) Does this happen every time? yes Other information: i think 'STATENEABLED' is a typo in ldtp.py
i found that setcursorposition, getcursorposition also give same kind of errors (though i dont think they are typos) >>>getcursorposition('*gedit','txt0') Traceback (most recent call last):
+ Trace 91286
_message = generatexml (command.GETCURSORPOSITION, _requestId, windowName, componentName)
>>> setcursorposition('*gedit','txt0',1) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.4/site-packages/ldtp.py", line 1266, in setcursorposition _message = generatexml (command.SETCURSORPOSITION, _requestId, windowName, componentName, str (position)) AttributeError: class command has no attribute 'SETCURSORPOSITION'
Srinivas: It works perfectly fine for me. Try uninstalling previous version of ldtp modules and install the new version of ldtp python module, which should solve the problem. Check ldtp.py in /usr/lib/python/site-packages and also in /usr/local/lib/python/site-packages