Microsoft windowds Based Script Host is crashing.
I have created a .vbs which is used to launch the QTP and load the test and run. I am running this on win XP machine with SP2. I have installed WSH 5.7.
When i try to run the .vbs file, i get error message Microsoft windows based script host has encountered a problem and need to close. We are sorry for inconvenience. The test stops.
Could you please suggest what is worng ? The code is below. Snapshot attached.
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible
' Set QuickTest run options
qtApp.Options.Run.ImageCaptureForTestResults = "OnError"
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False
qtApp.Open "C:\UIAutomation\PresenceTests\Presence_SoftPh_CUP C", True ' Open the test in read-only mode
' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Settings.Run.IterationMode = "rngIterations" ' Run only iterations 2 to 4
qtTest.Settings.Run.StartIteration = 2
qtTest.Settings.Run.EndIteration = 4
qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = "C:\UIAutomation\PresenceTests\Presence_SoftPh_CUP C\Res1" ' Set the results location
msgbox "test run"
qtTest.Run qtResultsOpt ' Run the test
MsgBox qtTest.LastRunResults.Status ' Check the results of the test run
qtTest.Close ' Close the test
Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object