Run QTP test script from command line(qc):
Hi friends I have been asked many times this question from my junior colleague, today I am going to share you one script which invoke your qtp test scripts from command line, run it and close it.
You need to just change the path of the your QTP test.
Following is the qtp script to run QTP test script from command line:
Dim qtApp ‘As QuickTest.Application ‘ Declare the Application object variable
Dim qtTest ‘As QuickTest.Test ‘ Declare a Test object variable
Set qtApp = CreateObject(“QuickTest.Application”) ‘ Create the Application object
qtApp.Launch ‘ Start QuickTest
qtApp.Visible = True ‘ Make the QuickTest application visible
‘just enter the path of the QTP test which you want to run.
qtApp.Open “C:\users\QTP\Test”, False ‘ Open the test in read-only mode
‘set run settings for the test
Set qtTest = qtApp.Test
qtTest.Run ‘ Run the test
qtTest.Close ‘ Close the test
If you are facing any issue to run qtp test script from command line you are always welcome to ask. Best Luck!!!