[LDTP-Dev] Cbo object not found

damien.aiello at bull.net damien.aiello at bull.net
Tue Jan 15 00:07:10 PST 2013


Hi,

I'm trying to make a proof of concept for a further benchmark.

What I want to do (under Windows XP) :
 - open notepad,
 - write a few words,
 - save the documents somewhere on the disks.

My code (work in progress) :
#-*- coding:utf-8 -*-

from ldtp import *
from ldtputils import *
import string
import random

try:
        launchapp("notepad", lang= "fr_FR.utf8")

        if waittillguiexist("frmSanstitre-Bloc-notes") == 0:
                raise LdtpExecutionError("Le bloc-notes n'est pas ouvert")

        enterstring("frmSanstitre-Bloc-notes", "strTest", "abc123")

        selectmenuitem("frmSanstitre-Bloc-notes", 
"mnuFichier;mnuEnregistrersous...")

        if waittillguiexist ("frmEnregistrersous") == 0:
                raise LdtpExecutionError ("Impossible d'ouvrir la boite de 
dialogue 'Fichier -> Enregistrer sous...'")

        settextvalue("frmEnregistrersous", "cboNomdufichier", "test.txt") 


except LdtpExecutionError, msg:
        raise

This code gives me the following error :
Unable to find Object: cboNomdufichier

But I can see this object if I do something like :
listeObjets=getobjectlist("frmEnregistrersous")
        for i in listeObjets:
                if guiexist("frmEnregistrersous", i):
                        print i

What I am doing wrong ?

PS : I'm working with Cobra3 and Python 2.7 for Windows.


Damien Aiello

Bull, 1 rue de Provence
38130 Echirolles
Tél. : 04 76 29 71 36
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/ldtp-dev/attachments/20130115/915e1207/attachment.html>


More information about the LDTP-dev mailing list