Micro Focus QTP (UFT) Forums
Driver Scripts and Result Viewer - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Driver Scripts and Result Viewer (/Thread-Driver-Scripts-and-Result-Viewer)



Driver Scripts and Result Viewer - rjkmr.aiht - 10-03-2012

Hi All

Im using Driver Scripts to Run All my Test scripts(Series of Scripts ),BUt the problem is Its only Showing the Results for the Last Run ,Could any One Here Help me for Getting the Results All the Run-Scripts

This is my Scripts -Which I saved it as .VBS and i have Attached The Controller Sheet ,Could one here Please Analysis this Please bring me A suggestion on this
Code:
''launching qtp
Set QTapp = CreateObject("QuickTest.Application")
If not QTapp.Launched Then
     QTapp.Launch
     QTapp.Visible = True
End if
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtResultsOpt.resultslocation="C:\Users\rsubrama\Desktop\result\"
ConPath = "C:\Users\rsubrama\Desktop\ControllerSheet.xls"
TestSuitePath = "C:\salesforce\Automation\Scripts\"
Set Exlapp = CreateObject("Excel.Application")
set wbook = Exlapp.Workbooks.Open(ConPath)
Set wsheet = wbook.Worksheets(1)
rc = wsheet.usedrange.rows.count

For i = 2 to rc
      sFlag = wsheet.cells(i,2).value
      If sFlag = "True" Then
          scrName = wsheet.cells(i,1).value
          resultName=wsheet.cells(i,6).value
          '' Open the script in qtp and associate and run
                QTapp.Open TestSuitePath & scrName ,False
                ''Associating the libraries
                
                QTapp.test.Run qtResultsOpt
            




                ''To read the status of Test execution
                
                result = QTapp.Test.LastRunResults.Status
            
                wsheet.cells(i,3).value =result
                If result = "Passed" Then
                      wsheet.cells(i,3).interior.color = vbgreen
                Else
                    wsheet.cells(i,3).interior.color = vbred
                End If
                'QTapp.Test.close        
        
    
     End If

Next


wbook.Save
wbook.Close
Exlapp.Quit
Exlapp = Nothing
QTapp = Nothing
QTapp.Quit