[LDTP-Dev] Error with settextvalue()

Alberto Mardegan alberto.mardegan at canonical.com
Mon Nov 28 05:58:07 PST 2011


Hi all,
  I'm using mago and ldtp (running on Ubuntu Oneiric) to test a Qt
application.
A snippet from my test case:

=====
        window = 'dlgEnteryourusername'
        assert ldtp.waittillguiexist(window) == 1
        log.debug('Window appeared')
        log.debug('Objects: %s' % ldtp.getobjectlist(window))
        ldtp.wait(2)
        ldtp.settextvalue(window, 'txtusername', 'pippo')
=====

Unfortunately, the last call fails with this error:

=====
Traceback (most recent call last):
  File
"/media/Data/src/bzr/accounts-sso/signon-ui/trunk/tests/signon-ui-test.py",
line 46, in username_query_dialog
    ldtp.settextvalue(window, 'txtusername', 'pippo')
  File "/usr/lib/python2.7/dist-packages/ldtp/client.py", line 54, in
__call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1575, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/dist-packages/ldtp/client.py", line 100, in
request
    raise LdtpExecutionError(e.faultString.encode('utf-8'))
ldtp.client_exception.LdtpExecutionError: Failed to grab focus for [text
| username]
=====

The window name and the component name should be correct, because the
previous getobjectlist(window) call tells me that there's a widget
called "txtusername".

Also, setting the input field (it's a QLineEdit) with the accerciser
tool works fine.

Any idea of what could be wrong?

Ciao,
  Alberto


More information about the LDTP-dev mailing list