Hi,
I am using UFT 14.53 Version.
we created AOM Object to launch uft tool and for test execution, and after completion of test execution uft tool needs to closed and start next iteration in the loop.
But after completion of test execution, UFT tool is not closing and UFT is throwing error as 'The operation failed because application is waiting for user input' and with error code 800A03F4
Below is the code for reference:
Dim App, qtTest, DriverPath
DriverPath = "E:\Automation\Chrome"
intIterationCnt = 3
intTestCnt = CInt(InputBox("Please enter the no. of test cases in the Execution Excel Sheet"))
'intTest = intTestCnt - (intTestCnt Mod 5)
intCnt = intTestCnt/intIterationCnt
If InStr(intCnt,".") <> 0 Then
intCnt = intCnt + 1
End If
intTest = Cint(Split(intCnt,".")(0))
Redim QTP_Tests(intTest)
For ctr = 1 To intTest
QTP_Tests(ctr) = DriverPath & "\AllModulesExecution\Scripts\DriverScript\CompleteModulesExecution_DriverScript"
If ctr = intTest Then
Exit For
End If
lb = (ctr*intIterationCnt - intIterationCnt)+1
ub = ctr*intIterationCnt
For i = lb to ub
Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
'Set QuickTest run options
App.Options.Run.ImageCaptureForTestResults = "Always"
App.Options.Run.RunMode = "Normal"
App.Options.Run.StepExecutionDelay = 0
App.Options.Run.ViewResults = False
App.Options.Run.AutoExportReportConfig.AutoExportResults = True
App.Options.Run.AutoExportReportConfig.StepDetailsReport = True
App.Options.Run.AutoExportReportConfig.DataTableReport = False
App.Options.Run.AutoExportReportConfig.LogTrackingReport = False
App.Options.Run.AutoExportReportConfig.ScreenRecorderReport = True
App.Options.Run.AutoExportReportConfig.SystemMonitorReport = False
App.Options.Run.AutoExportReportConfig.ExportLocation = DriverPath & "\AllModulesExecution\Result\TestExecutionResult"
App.Options.Run.AutoExportReportConfig.UserDefinedXSL = ""
App.Options.Run.AutoExportReportConfig.StepDetailsReportType = "PDF"
App.Options.Run.AutoExportReportConfig.StepDetailsReportFormat = "Detailed"
App.Options.Run.AutoExportReportConfig.ExportForFailedRunsOnly = True
wscript.sleep 1000
App.Open QTP_Tests(ctr),True ' Open the test in read-only mode
Set qtTest = App.Test
qtTest.Settings.Run.OnError = "NextStep"
qtTest.Run ' Run the test
qtTest.close
wscript.sleep 1000
App.Quit
Set qtTest = Nothing
Set App = Nothing
wscript.sleep 1000
Next
Next
I am using UFT 14.53 Version.
we created AOM Object to launch uft tool and for test execution, and after completion of test execution uft tool needs to closed and start next iteration in the loop.
But after completion of test execution, UFT tool is not closing and UFT is throwing error as 'The operation failed because application is waiting for user input' and with error code 800A03F4
Below is the code for reference:
Dim App, qtTest, DriverPath
DriverPath = "E:\Automation\Chrome"
intIterationCnt = 3
intTestCnt = CInt(InputBox("Please enter the no. of test cases in the Execution Excel Sheet"))
'intTest = intTestCnt - (intTestCnt Mod 5)
intCnt = intTestCnt/intIterationCnt
If InStr(intCnt,".") <> 0 Then
intCnt = intCnt + 1
End If
intTest = Cint(Split(intCnt,".")(0))
Redim QTP_Tests(intTest)
For ctr = 1 To intTest
QTP_Tests(ctr) = DriverPath & "\AllModulesExecution\Scripts\DriverScript\CompleteModulesExecution_DriverScript"
If ctr = intTest Then
Exit For
End If
lb = (ctr*intIterationCnt - intIterationCnt)+1
ub = ctr*intIterationCnt
For i = lb to ub
Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
'Set QuickTest run options
App.Options.Run.ImageCaptureForTestResults = "Always"
App.Options.Run.RunMode = "Normal"
App.Options.Run.StepExecutionDelay = 0
App.Options.Run.ViewResults = False
App.Options.Run.AutoExportReportConfig.AutoExportResults = True
App.Options.Run.AutoExportReportConfig.StepDetailsReport = True
App.Options.Run.AutoExportReportConfig.DataTableReport = False
App.Options.Run.AutoExportReportConfig.LogTrackingReport = False
App.Options.Run.AutoExportReportConfig.ScreenRecorderReport = True
App.Options.Run.AutoExportReportConfig.SystemMonitorReport = False
App.Options.Run.AutoExportReportConfig.ExportLocation = DriverPath & "\AllModulesExecution\Result\TestExecutionResult"
App.Options.Run.AutoExportReportConfig.UserDefinedXSL = ""
App.Options.Run.AutoExportReportConfig.StepDetailsReportType = "PDF"
App.Options.Run.AutoExportReportConfig.StepDetailsReportFormat = "Detailed"
App.Options.Run.AutoExportReportConfig.ExportForFailedRunsOnly = True
wscript.sleep 1000
App.Open QTP_Tests(ctr),True ' Open the test in read-only mode
Set qtTest = App.Test
qtTest.Settings.Run.OnError = "NextStep"
qtTest.Run ' Run the test
qtTest.close
wscript.sleep 1000
App.Quit
Set qtTest = Nothing
Set App = Nothing
wscript.sleep 1000
Next
Next