Saturday, January 9, 2010

Running QTP Scripts/Tests at Scheduled Time

Running QTP Scripts/Tests at Scheduled Time

You can run set of tests using the Automation Object Model, you can also run batch of tests using Quality Center, and you can use Test Batch Runner also to run set of tests. Earlier you had Test Batcher and Multi-test Manager. Below you can see the steps to Schedule a task using "Scheduled Task" from Control Panel.

Open a Notepad and write the below lines in it:

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

Save this file as a.vbs. I saved it under C:\a.vbs.

Now go to Control Panel and double click on Scheduled Tasks icon. Double click on Add Scheduled Task to open Scheduled Task wizard as shown below. Click Next.



Browse and locate that a.vbs file as shown below.



Select the file and click open.



For this example we will run it only for one time. Click Next.



Choose time and date. Click Next.



Enter user name and password. Click Next.



Click Finish.



Below you can see how our scheduled task looks like. At the specific time and date this scheduled task should run fine.



This below window shows up if you have checked "Open Advanced properties for this task when I click Finish" checkbox in the above Scheduled Task Wizard. Below you can also see different tabs (Task, Schedule, Settings, Security) for this window, where you can set other options accordingly.