List Icon
Archive de la liste de diffusion

La liste de diffusion est fermée depuis juillet 2022, mais sert toujours d'archive d'informations sur QF-Test.
Cependant, si vous souhaitez rester informé des nouveautés concernant QF-Test, vous pouvez simplement vous abonner à la newsletter :
abonner à la newsletter 

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

Re: [QF-Test] Writing QFT O/P to excel

  • Subject: Re: [QF-Test] Writing QFT O/P to excel
  • From: "Yann Spoeri, QFS Support (Extern)" <support@?.de>
  • Date: Thu, 14 May 2015 21:16:26 +0200

Hi Vinod and all other list participants,

QF-Test saves the commandline output of an application in the special variable ${qftest:client.output.<name of the client>} (cmp. So in order to access the client output in a script, you can use a
line like:

clientOutput = rc.lookup("qftest", "client.output.<name of the client>")

The client output needs to get parsed and stored into an excel file then.

Writing to an excel file:

QF-Test comes along with two librarys to write to an excel file. The older one is jxl. An example for writing to an excel file using jxl can
already be found on the mailing list:
The other library is apache poi:

from org.apache.poi.hssf.usermodel import HSSFWorkbook
from org.apache.poi.xssf.usermodel import XSSFWorkbook
from import Cell, Row
from import FileInputStream, FileOutputStream, FileNotFoundException

# The excel file to create and write to
excelFilePath = "D:\\sup\\example.xlsx"
# The name of the sheet in the excel file to write to
sheet = "example"
# The row to write to (0-indexed).
rowToWriteTo = 10
# The col to write to (0-indexed).
colToWriteTo = 10
# The text to write to that cell
textToWrite = "Hello World"

# create a new excel workbook
wb = HSSFWorkbook()
# check if the sheet already exist; if not create it
ws = None
ws = wb.getSheet(sheet)
if ws == None:
    ws = wb.createSheet(sheet)
# get the cell in the sheet
row = ws.getRow(rowToWriteTo)
if row == None:
    row = ws.createRow(rowToWriteTo)
cell = row.getCell(colToWriteTo)
if cell == None:
    cell = row.createCell(colToWriteTo)
# write to that cell
# write everything to file
fileOut = FileOutputStream(excelFilePath)

Last but not least you can also write to a csv file which is often easier to program. Jython comes along with a great csv reading and writing
library; see: . It's no problem to open csv files in excel.

Greetings & Happy testing,

Am 12.05.2015 um 09:20 schrieb Hejib, Vinod IN BLR STS:
Hi all,

I have an application which generates test-case numbers as o/p when run using QFT.
I want to write these o/p test cases(numbers) to excel.Can you please tell how can I do the same.

###	I want to write below generated o/p to excel in each column.

No of usecases 	4
No of tests		2
No of procedures	8


qftest-list mailing list


Get the most out of QF-Test - Support directly from the authors
* Training & consulting:
* Phone & email support:

Yann Felix Spöri (Extern)

E: support@?.de
T: +49 (0)8171 38648-20
F: +49 (0)8171 38648-16

Quality First Software GmbH |
Tulpenstr. 41 | 82538 Geretsried | Germany
GF Gregor Schmid, Karlheinz Kellerer
HRB München 140833