[1] I wrote one vbs file to launch QTP and run test cases
[2]. It can works well on 64bit OS
[3]. but error happened when i changed the test path and ran it on 32bit OS "The systemcannot locate the object specified" , sometimes, error is "cannot open test".
I checked the error line: qtApp.Open ezscriptPath, True
It could work if i launched QTP first.
Could you help me to check this problem? thanks~
Code:
Dim qtApp
Dim qtTest
Dim qtResultsOpt
Dim scriptPath
Dim ResultPath
Dim qtpLogPath
ezscriptPath = "C:\Users\admin\Desktop\Study\Test_try"
ezResultPath = "C:\Users\admin\Desktop\Study\TestResult"
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True ' Make the QuickTest application visible
wscript.sleep 10000
' Set QuickTest run options
qtApp.Options.Run.CaptureForTestResults = "OnError"
qtApp.Options.Run.RunMode = "Normal"
qtApp.Options.Run.ViewResults = False
qtApp.Open ezscriptPath, True ' Open the test in read-only mode
' set run settings for the test
Set qtTest = qtApp.Test
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 = ezResultPath ' Set the results location
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
[3]. but error happened when i changed the test path and ran it on 32bit OS "The systemcannot locate the object specified" , sometimes, error is "cannot open test".
I checked the error line: qtApp.Open ezscriptPath, True
It could work if i launched QTP first.
Could you help me to check this problem? thanks~