Forum Discussion
- jeffrey_crowleyContributorRather than trying to drive Excel from TC and manage what row I'm on, etc. I write output to a CSV (Comma Separated Values) file using aqFile.WriteToTextFile(). For those unfamiliar with a CSV file, it's just a text file where cell information is separated by commas.
For example, a simple CSV will be in the format below.
R1C1,R1C2,R1C3
R2C1,R2C2,R2C3
R3C1,R3C2,R3C3
When your run is completed, you can open the CSV file in Excel and use filtering, pivot tables/charts, and other Excel features to browse your results.
For simple scenarios, I just use the TC logs. I only use the CSV when I verify values for ~800 products on our eCommerce site where a typical run will have upwards of 44,000 validations. The TC logs were just too much to go through, filter, etc. so I use this method instead.
One issue I ran into was that some of the values (sentences, etc.) that I wrote to the log contained commas which in CSV format means to end the cell. To get around this, I found a different character (the pipe, |) and wrote that as my separator instead of a comma. I then use the text import feature of Excel and specify that my values are separated with a | and everything works. - mesg2anilRegular ContributorHello... anyone out there...?!?!?
- ArmandsBrunsFrequent ContributorHi Anil,
look this link, maybe that will help you
http://support.smartbear.com/viewarticle/20878/
Armands - mesg2anilRegular ContributorHi Armands,
This link is about how to write data to excel, but I'm looking for "how to export test results to excel sheet". - ArmandsBrunsFrequent Contributor
- mesg2anilRegular ContributorHi Armands,
Thank you for all the help you are providing...
The link you provided will export database table data to excel sheet.
What exactly I'm trying to do is, once the script is run, all the messages of test result should get exported to excel sheet. I'm also trying to search in TC forum and through google but looks like there is no help or support available on this. I doubt this feature or possbility is there in TestComplete to export test result to excel sheet. - mesg2anilRegular ContributorLooks like there is no solution to this issue in TC :(
- praveensqaContributorHi,
Here is the code:
Sub ExportResults
FileName = Project.ConfigPath + "Log\MyResults.mht"
Log.SaveResultsAs FileName, 2
End Sub
0= lsXML or 0 (default)
1= lsHTML (or 1)
2= lsMHT (or 2) - praveensqaContributor''''Excel:
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
intRow = 2
objExcel.Cells(1, 1).Value = "starttrack"
'Your Existing Vbs Script Goes Here.
A= "PASS"
B="FAIL"
If VRes_code=Code_number Then
Log.Message "Responce Code:"+VRes_code+" PASS"
objExcel.Cells(intRow, 1).Value = A
else
objExcel.Cells(intRow, 1).Value = B
Log.Error "Responce Code:"+VRes_code+" FAIL"
end if - mesg2anilRegular ContributorHi Praveen,
Thank you for the code...
Your first code is not writing anything to the excel sheet, can you please check the first code and let me know any changes to be made.
Second code is working fine, but I already have this info with me. My requirement is: I want to write the log to excel sheet, the way .mht is created, I want same data in excel from .mht.
Thanks again!
Related Content
- 7 years ago
- 3 years ago
- 3 months ago
- 8 years ago
- 3 years ago
Recent Discussions
- 2 days ago
- 2 days ago
- 6 days ago