Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - How can we export test results to an excel sheet in QTP?




355
views
asked marvit August 21, 2014 06:33 AM  

How can we export test results to an excel sheet in QTP?


           

1 Answers



 
answered By Dharma   0  
Dim strTestPath ' full filepath to the test
strTestPath = "C:\Program Files\Mercury Interactive\QuickTest Professional\Tests\testresultsexample"

' Launch QuickTest
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

' Run the Test
qtApp.Open strTestPath, False ' Open the test Set qtTest = qtApp.Test
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object

testres = "C:\temp\Res1" ' Original location for the test results.
qtResultsOpt.ResultsLocation = testres ' Specify the location to save the test results.
qtTest.Run qtResultsOpt, True ' Run the test and wait until end of the test run

' Close QuickTest Professional
qtApp.Quit

' Copy the test results to additional locations.
Set fso = CreateObject("Scripting.FileSystemObject")

fso.CopyFolder testres, "C:\temp\Res2_copy"
fso.CopyFolder testres, "C:\Program Files\Mercury Interactive\QuickTest Professional\Tests\testresultsexample\CopiedRes1"

Set fso = Nothing
Set qtResultsOpt = Nothing
Set qtApp = Nothing
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert