Here in I have got sample AOM file which invokes QTP test. This file also pushes test results to a designated folder. Herein there is no hard coding of path ant where in AOM file -
##################################################
Dim qtpApp 'As QuickTest qtpApplication
Set qtpApp = CreateObject("QuickTest.Application")
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable
qtpApp.Launch
qtpApp.Visible = True
qtpApp.Test.Settings.Launchers("Web").Active = False
qtpApp.Test.Settings.Launchers("Web").CloseOnExit = True
qtpApp.Test.Settings.Run.ObjectSyncTimeOut = 240000
qtpApp.Test.Settings.Run.DisableSmartIdentification = True
qtpApp.Test.Settings.Run.OnError = "Dialog"
qtpApp.Test.Settings.Web.BrowserNavigationTimeout = 60000
qtpApp.Options.Run.RunMode = "Fast"
qtpApp.Options.Run.ViewResults = True
qtpApp.Options.Run.MovieCaptureForTestResults = "Never"
qtpApp.Options.Web.AddToPageLoadTime = 10
qtpApp.Options.Web.BrowserCleanup = True
qtpApp.Options.Run.ImageCaptureForTestResults = "OnError"
'Get path to trunk
sn = Wscript.ScriptName 'Script Name
fn = Wscript.ScriptFullName 'Fully Qualified Script Name
fp = Replace(fn, "\" & sn, "") ' Drive / Folder path
Set fso = CreateObject("Scripting.FileSystemObject")
'Open the test in read-only mode
qtpApp.Open fso.GetFolder(fp).ParentFolder& "\test_scripts\GSBRegMF1Event", True
'Create the Run Results Options object
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
'Set the results location
timeStamp = FormatDateTime(Now, 1)&" "& Hour(Time) &"-"& Minute(Time) &"-"& Second(Time)
qtResultsOpt.ResultsLocation = fso.GetFolder(fp).ParentFolder& "\results\GSBRegMF1Event\" &timeStamp
qtpApp.Test.Run qtResultsOpt 'Run the test
Set qtpApp = Nothing
Set qtResultsOpt = Nothing
Set fso = Nothing
##################################################
##################################################
Dim qtpApp 'As QuickTest qtpApplication
Set qtpApp = CreateObject("QuickTest.Application")
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable
qtpApp.Launch
qtpApp.Visible = True
qtpApp.Test.Settings.Launchers("Web").Active = False
qtpApp.Test.Settings.Launchers("Web").CloseOnExit = True
qtpApp.Test.Settings.Run.ObjectSyncTimeOut = 240000
qtpApp.Test.Settings.Run.DisableSmartIdentification = True
qtpApp.Test.Settings.Run.OnError = "Dialog"
qtpApp.Test.Settings.Web.BrowserNavigationTimeout = 60000
qtpApp.Options.Run.RunMode = "Fast"
qtpApp.Options.Run.ViewResults = True
qtpApp.Options.Run.MovieCaptureForTestResults = "Never"
qtpApp.Options.Web.AddToPageLoadTime = 10
qtpApp.Options.Web.BrowserCleanup = True
qtpApp.Options.Run.ImageCaptureForTestResults = "OnError"
'Get path to trunk
sn = Wscript.ScriptName 'Script Name
fn = Wscript.ScriptFullName 'Fully Qualified Script Name
fp = Replace(fn, "\" & sn, "") ' Drive / Folder path
Set fso = CreateObject("Scripting.FileSystemObject")
'Open the test in read-only mode
qtpApp.Open fso.GetFolder(fp).ParentFolder& "\test_scripts\GSBRegMF1Event", True
'Create the Run Results Options object
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
'Set the results location
timeStamp = FormatDateTime(Now, 1)&" "& Hour(Time) &"-"& Minute(Time) &"-"& Second(Time)
qtResultsOpt.ResultsLocation = fso.GetFolder(fp).ParentFolder& "\results\GSBRegMF1Event\" &timeStamp
qtpApp.Test.Run qtResultsOpt 'Run the test
Set qtpApp = Nothing
Set qtResultsOpt = Nothing
Set fso = Nothing
##################################################
Comments
Post a Comment
No spam only genuine comments :)