Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting run time error while executing the QTP script in command prompt.
#1
Solved: 10 Years, 8 Months ago Exclamation 
Hi All,

I'm getting the below error when I tried to run the QTP script via command prompt.

Error Message: cmd_QTP.vbs<13,1> Microsoft VBScript runtime error: Type mismatch: 'Run'

In command prompt i'm using the command

cscript //nologo cmd_QTP.vbs

Code:
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

qtApp.Open "C:\Users\Vi$hruth143\Desktop\QTP\Scripts\LogIn", True ' Open the test in read-only mode

' set run settings for the test
Set qtTest = qtApp.Test
[b]qtTest.Run qtResultsOpt ' Run the test[/b]

WScript.StdOut.Write "Status is: " & qtTest.LastRunResults.Status ' Check the results of the test run
qtTest.Close ' Close the test

Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object

I doubt the error is on code line 13 which is higlighted in the above code.

Please help me to get this resolved.

Thanks
Vishruth
Reply


Messages In This Thread
Getting run time error while executing the QTP script in command prompt. - by vishruth143 - 07-15-2013, 02:58 AM

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,521 03-25-2021, 08:27 AM
Last Post: RB26578
  error when executing an UFT automation script alexalloza 0 1,391 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)