Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error: The systemcannot locate the object specified happened
#1
Not Solved
[1] I wrote one vbs file to launch QTP and run test cases
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
[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~


Attached Files Image(s)
   

.txt   RunQTP.txt (Size: 1.45 KB / Downloads: 176)
Reply
#2
Not Solved
ezscriptPath = "C:\Users\admin\Desktop\Study\Test_try"
Looks like the path mentioned above is not correct.Please go to testscript location and copy the path and check if its the same.
Reply
#3
Not Solved
>>>
I checked my path,it's correct.
because the script can be ran well if i launched QTP first manually. the problem just happened when I stop the QTP process and let vbscript to launch QTP and run test cases 。



and sometimes
"Error: Cannot open test
Code: 800A03EE" happened
Reply
#4
Not Solved
I used QTP11
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  General Object Error(Find Object Error) akhandesh 1 3,551 02-24-2016, 01:05 PM
Last Post: sindhus
  Can't locate items on Win7 Desktop RandomGrin 0 2,059 01-30-2015, 10:55 PM
Last Post: RandomGrin
  Error while creating object using description.create object in VB script SarodeGirish 5 6,203 06-19-2012, 05:30 PM
Last Post: ssvali
  Object Required Error branjitk 6 12,619 06-07-2012, 12:43 PM
Last Post: branjitk
  Object Required Error rohit330 0 2,813 05-07-2012, 10:16 PM
Last Post: rohit330

Forum Jump:


Users browsing this thread: 1 Guest(s)