Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting run time error while executing the QTP script in command prompt.
#2
Solved: 10 Years, 8 Months, 1 Week ago
What you said was correct. I think i have solved the issue you are facing. Just check this code
first you have to create an object and if not able to create. check if your running Admin mode
Code:
Dim App
Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
Dim QTP_Tests(2)
QTP_Tests(1) = "C:\Documents and Settings\thomas\Desktop\Tests\paypage hits"
QTP_Tests(2) = "C:\Documents and Settings\thomas\Desktop\Tests\digitsecure net docs"
'Creating the RunResultsOptions object. It is a collection of properties that indicate preferences for the run results. E.g. ResultsLocation property as used below which tells the path in which the run results will be stored.
Set res_obj = CreateObject("QuickTest.RunResultsOptions")
For i = 1 to UBound (QTP_Tests)
App.Open QTP_Tests(i), True
Set QTP_Test = App.Test
res_obj.ResultsLocation = QTP_Tests(i) & "\Res25" ' Set the results location
'Using the Run method. Run Method runs the open test or business component and creates results in the specified file or Quality Center path. A Boolean value - true or false can be set. Indicates whether the Test.Run statement waits until the end of the run before performing the next statement in the automation script. Default=True.
QTP_Test.Run res_obj, True
QTP_Test.Close
Next
App.Quit
Set res_obj = nothing
Set QTP_Test = nothing
Set App = nothing
Reply


Messages In This Thread
RE: Getting run time error while executing the QTP script in command prompt. - by vinod123 - 07-15-2013, 05:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to send/pass UFT Run Error Dialog as output value to main driver script lravi4u 0 328 11-05-2023, 03:55 PM
Last Post: lravi4u
  How do you Change Run mode mid script? Caleytown 6 6,523 03-25-2021, 08:27 AM
Last Post: RB26578
  error when executing an UFT automation script alexalloza 0 1,394 10-30-2018, 06:17 PM
Last Post: alexalloza
  Executing via create "RES"xx folder? nishitd 0 1,112 03-07-2018, 01:09 AM
Last Post: nishitd
  Telnet command not recognized Sanjana1987 1 1,851 09-20-2017, 03:16 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)