How do I export custom results to an Excel file?

How do I export custom results to an Excel file?


How do I export custom results to an Excel file?


This is indeed possible, you can export custom results of your choosing to an Excel file. In the example below I have exported some timer details of a testcase running against the SilkTest Test Application.

Firstly you need to have the following code in a frame file and call it for example and then save it in the desired location, in this case I saved it to the C: drive. There is a version of this frame file attached to this article.

Note that I have created a custom TestCaseEnter and TestCaseExit functions in order to create, start and stop the timer for the test. This also assigns these values to the relevant variables.

Next you need to create a blank Excel document and in this case I called it Results.xls and saved it to the C: drive. You can see the ConnectString for the Excel sheet at the top of the frame file. In this Excel file you need to name the columns (top row of data) as the data that you wish to export, in this case I am exporting "sDate, sScriptName, sTestCaseName, sStartTime, sEndTime, sTime, sTesterName, sStatus and sMessage".

Finally you need to create a simple testcase and call the frame file you created using the use statement.

Then when you run a testcase you will see that the Results.xls file will get populated with the data you selected. In this case I ran a number of tests, note that the Excel sheet gets appended so the results are added one after another. As you can see I have also included error handling in the TestCaseExit so that any error message created in SilkTest are also exported to the Excel file.

I have attached a sample SilkTest project that runs against the Test Application, an example of the Results.xls file and the frame file needed for your reference on how to achieve this functionality.
Test Application.stp
Old KB# 30175


Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.

hello, I am not able to check the attachements

Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 20:44
Updated by:
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.