Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"How to Export results into EXCEL"
12-16-2011, 09:20 AM
Post: #1
"How to Export results into EXCEL"

Hi Folks,

After completion of successful run we are getting the results so, how we can export that results into excel sheet.In QTP we have any methods to export results into Execl sheet.

I am using QTP v10.0
Find all posts by this user
Quote this message in a reply
12-16-2011, 10:54 AM
Post: #2
RE: "How to Export results into EXCEL"
QTP results to Excel

There are 2 functions

1) initOutExcel(sTablePath)

Description : This function is to initialize a particular Excel Where you want to update the Results of the QTP Tests.

2) WriteResults(sTablePath,sStatus,sFunctionality,sDescription)

Description : This function appends the Result of a Test to the end of the existing results.

You can modify the below functions to suite your requitrement.

CODE:

Function initOutExcel(sTablePath)

Datatable.addSheet "Results"

Datatable.importSheet sTablePath, "Results","Results"

iParamCount = Datatable.getSheet("Results").getParameterCount

if iParamCount = 0 Then

Datatable.getSheet("Results").addParameter "S.No",""

Datatable.getSheet("Results").addParameter "Status",""

Datatable.getSheet("Results").addParameter "Functionality",""

Datatable.getSheet("Results").addParameter "Description",""

End If

Datatable.ExportSheet sTablePath,"Results"

End Function

Function WriteResults(sTablePath,sStatus,sFunctionality,sDescription)

Datatable.addSheet "Results"

Datatable.importSheet sTablePath, "Results","Results"

iRowCount = Datatable.getSheet("Results").getRowCount

Datatable.getSheet("Results").setCurrentRow(iRowCount+1)

Datatable("S.No","Results") = iRowCount+1

Datatable("Status","Results") = sStatus

Datatable("Description","Results") = sDescription

Datatable("Functionality","Results") = sFunctionality

Datatable.ExportSheet sTablePath,"Results"

End Function


Regards,
Sankalp
Find all posts by this user
Quote this message in a reply
12-16-2011, 03:13 PM
Post: #3
RE: "How to Export results into EXCEL"
Sures,

You can use

Datatable.Export "<DesiredResultExcelFileName>


Regards,
Ankesh
Find all posts by this user
Quote this message in a reply
02-14-2012, 01:42 PM
Post: #4
RE: "How to Export results into EXCEL"
you can directly write executed result into excel sheet by using excel operation by using creation of excel object
Find all posts by this user
Quote this message in a reply
02-16-2012, 04:24 AM (This post was last modified: 02-16-2012 04:24 AM by alencooperr.)
Post: #5
RE: "How to Export results into EXCEL"
According to me, Export is the great technique for you use expect to copy from Access to Excel usually. When you perform that operation, You also can save the details for any kind of future use and also re-schedule the export to run automatically at set intervals..
Find all posts by this user
Quote this message in a reply
02-21-2012, 09:15 AM
Post: #6
RE: "How to Export results into EXCEL"
Datatable.Export "<path>
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)