Logo QF-Test

Im Archiv der Mailingliste
wertvolle Antworten finden.

 

Gratis Testen  Download  Kaufen

Thomas Max, QF-Test Training und Support

Tipp für die Recherche in der Mailingliste: Volltextsuche (oben) verwenden.

Thomas Max,
Sr. Software Engineer & Trainer, QFS

2017 bis heute 2016 2015 2014 | 2013 | 2012 | 2011 2010 2009 | 2008 | 2007

(ältere Archiveinträge vor 2007 nicht dargestellt, aber in der Suche enthalten)

Mailingliste - Einträge 2007


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [QF-Test] qf -test daemon


  • Subject: Re: [QF-Test] qf -test daemon
  • From: "Robert Lahmer, QFS support" <support@?.de>
  • Date: Tue, 31 Jul 2007 14:37:27 +0200


Hello George,

take the following lines as a Jython Server script example to execute a
test-case with a QF-Test daemon:


from de.qfs.apps.qftest.daemon import DaemonRunContext
from de.qfs.apps.qftest.daemon import DaemonLocator
from java.io import FileOutputStream, ByteArrayInputStream

# change the variable values accordingly
host = "localhost"
port = 5555
testcase = "h:\\rl\\qftest\\daemon\\daemon.qft#Test1"
logFile = "c:\\tmp\\myLog.qrl"

daemon = DaemonLocator.instance().locateDaemon(host, port)
if daemon != None:
 rc.logMessage("Daemon running, ...")
 testRunDaemon = daemon.createTestRunDaemon()
 if testRunDaemon != None:
   runContext = testRunDaemon.createContext()
   if runContext != None:
     rc.logMessage("Start Tests ...")
     runContext.runTest(testcase)
     rc.logMessage("... Tests gestartet.")
     runContext.waitForRunState(DaemonRunContext.STATE_FINISHED, 30000)
     try:
       result = runContext.getResult()
       rc.logMessage("Received result ... " + `result`)
     except:
       rc.logWarning("Testcase probably not finished yet - increase
timeout")
       raise
     try:
       runLog = runContext.getRunLog()
       fos = FileOutputStream(logFile)
       bai = ByteArrayInputStream(runLog)
       for b in range(len(runLog)):
         fos.write(bai.read())
       fos.close()
     except:
       pass
   else:
     rc.logError("Could not create run-context -> license!?")
 else:
   rc.logError("Could not create test-run-daemon!")
 ### Uncomment the following code line to terminate the daemon
 ### - otherwise you have to kill the daemon process.
 #daemon.terminate(0)
else:
 rc.logError("No daemon running!")


Before running the script within QF-Test, you have to start another QF-Test
instance in daemon mode on the (remote) test-host (e. g. by means of shh or
VNC):

 qftest -batch -daemon -daemonport 5555

Note that QF-Test does not run as a Windows Service. Further it is assumed
in this example that you have a test-suite "daemon.qft" with a test-case
"Test1" on your test-host (as specified in the testcase variable above).

Of course, you are not bound to QF-Test Server scripting when controlling
the QF-Test daemon. You can as well write a little Java application to do
this job (what will furthermore not consume an additional license).

Best regards,
   Robert



--On Dienstag, Juli 31, 2007 11:50:44 +0200 George Comanescu
<george.comanescu@?.com> wrote:



Hello I have a series of tests which I want to run automatically

And the documentation from Qf-test it's not clear to me.

So I must start a service (in Windows )

Something like this :

qftest -daemon -port 6600 -batch

How do I connect from an other computer using a client and specify to him
which tests must be run .

And from where to take it ?

Thank you,

G.





--
Robert Lahmer
Quality First Software GmbH                http://www.qfs.de
Tulpenstr. 41                           Tel: +49 8171 919874
DE-82538 Geretsried                     Fax: +49 8171 919876
GF: Gregor Schmid, Karlheinz Kellerer     HRB München 140833




Videos Downloads Dokumentation Kaufen Gratis Testen