from ldtp import * from ldtputils import * xmlParser = LdtpDataFileParser (datafilename) try: log ("test script", "teststart") selectmenuitem ("frmMailbox*-Evolution", "mnuComposeNewMessage") waittillguiexist ("frmComposeMessage") click ("frmComposeMessage", "btnAttach") waittillguiexist ("dlgInsertAttachment") wait(2) tblPlaces = xmlParser.gettagvalue ("tblPlaces") selectrow ("dlgInsertAttachment", "tblPlaces", tblPlaces [0]) click ("dlgInsertAttachment", "tbtntester") wait (2) tblPlaces = xmlParser.gettagvalue ("tblPlaces") selectrow ("dlgInsertAttachment", "tblPlaces", tblPlaces [0]) click ("dlgInsertAttachment", "btnAttach") wait (2) click ("dlgInsertAttachment", "tbtnDesktop") wait (2) tblFiles = xmlParser.gettagvalue ("tblFiles") selectrow ("dlgInsertAttachment", "tblFiles", tblFiles [0]) click ("dlgInsertAttachment", "btnAttach") waittillguinotexist ("dlgInsertAttachment") txtTo = xmlParser.gettagvalue ("txtTo") settextvalue ("frmComposeMessage", "txtTo", txtTo [0]) txt6 = xmlParser.gettagvalue ("txt6") settextvalue ("frmComposeMessage", "txt6", txt6 [0]) txtSubject = xmlParser.gettagvalue ("txtSubject") settextvalue ("frmComposeMessage", "txtSubject", txtSubject [0]) click ("frmhi", "btnSend") waittillguinotexist ("frmhi") log ("test script", "pass") log ("test script", "testend") except LdtpExecutionError, msg: log (str (msg), "cause") log ("test script", "fail") log ("test script", "testend") raise LdtpExecutionError (str (msg))