How to launch QTP using VB Script?

We will see how to launch QTP using simple VB Script snippet. First we need to declare an object using below syntax:

Dim qtpApp as QuickTest.Application
Set qtpApp=new QuickTest.Application
Set qtpApp = CreateObject("QuickTest.Application")
  • To check whether QTP is already open, use Application.Launched or Application.GetStatus
  • To return all the addins collection object, use Application.Addins
  • To retrieve associated add-ins (Application.GetAssociatedAddinsForTest)
  • To set the add-ins you want to load when QuickTest starts (Application.SetActiveAddins)
  • To instruct QuickTest whether to open in visible or minimized mode (Application.Visible)
  • To specify which view (Keyword or Expert View) to display when QuickTest opens, if opening QuickTest in Visible mode (Application.ActivateView)
  • To instruct QuickTest to start and open a new, blank test or component (Application.New or Application.NewBusinessComponent)
  • To instruct QuickTest to start and open a specified, existing test or component (Application.Open or Application.OpenBusinessComponent)
  • To quit QTP application, use qtpApp.Quit and Set qtpApp = nothing
‘Below example configures QuickTest views and panes '************************************************************************************************************************
Dim qtpApp 'As QuickTest.Application ' Declare the Application object variable
Set qtpApp = CreateObject("QuickTest.Application") ' Create the Application object
qtpApp.Launch ' Start QuickTest
qtpApp.ActivateView "ExpertView" ' Display the Expert View
qtpApp.ShowPaneScreen "ActiveScreen", True ' Display the Active Screen pane
qtpApp.ShowPaneScreen "DataTable", False ' Hide the Data Table pane
qtpApp.ShowPaneScreen "DebugViewer", True ' Display the Debug Viewer pane
qtpApp.WindowState = "Maximized" ' Maximize the QuickTest window
qtpApp.Visible = True ' Make the QuickTest window visible

Set qtpApp = Nothing ' Release the Application object

Thanks for visiting QAInsights! Check out our new portal to get updates on Software Testing related certifications. We’re always posting interesting articles on QAInsights. I request you to subscribe so you don’t miss out anything. Searching for QA Jobs Openings, check it at

Want to start a blog like this, please visit SpidyDomain to buy cheap web hosting and register domain.

Subscribe to our QAInsights YouTube Channel

Subscribe our free weekly newsletter or Google feeds

Once a week we send a digest with the most popular articles.

About NaveenKumar Namachivayam

Hi there! is a passionate and experienced Performance Test Analyst based in Chicago, IL, USA with the skill sets in Manual Testing, Test Automation, Performance Testing, and Web Services. He loves to learn and experiment new trends and models in Software Testing. Please stop by at his personal blogs:, PerfTractor and Giftt

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.