'Automation Object Model
'********************************************************************
'********************************************************************
' GAReddy @ OneTestingCenter @ QTP - AOM (Automation Object Model)
' What ==> This is a QTP - AOM Script to Open QTP , To Open Driver Script (To Open Existing Script ) and to Run the Test
' How ==> Need QuickTest.Application Automation Object to do so
' Why ==> To Open a Driver Script (which could call other tests) and to Run Automatically
' Author : GAReddy @ OneTestingCenter @ QTP
'*********************************************************************
'********************************************************************
Dim oQTP
Dim QTPTest
Set oQTP = CreateObject("QuickTest.Application") ' Create the Application object
oQTP.Launch ' Start QuickTest
oQTP.Visible = True ' Make the QuickTest application visible
' Set QuickTest run options
oQTP.Options.Run.ImageCaptureForTestResults = "OnError"
oQTP.Options.Run.RunMode = "Fast"
oQTP.Options.Run.ViewResults = False
oQTP.Open "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\DriverScript", True ' Open the test in read-only mode
' set run settings for the test
Set QTPTest = oQTP.Test
QTPTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs
QTPTest.Run ' Run the test
MsgBox QTPTest.LastRunResults.Status ' Check the results of the test run
QTPTest.Close ' Close the test
Set QTPTest = Nothing ' Release the Test object
Set oQTP = Nothing ' Release the Application object
'**********************************************************************
'*********************************************************************
0 comments:
Post a Comment