There can be situations when you need to schedule your QTP scripts so that they can run when you are not present in front of your PC. I will show you a demo below.

Create a .vbs file to launch QTP with required settings, add-ins etc.

Here is a sample vbs code

Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
App.WindowState = "Maximized"' Maximize the QuickTest window
App.ActivateView "ExpertView"' Display the Expert View
App.open "C:Program Files/Mercury Interactive/
QuickTest Professional/Tests/Test1", False
'Opens the test in editable mode

Ok, for the first timers. Create a sample QTP test and save it as Test1 at the location above. Copy the code into notepad and name the file as testing.vbs

Now we will automate the opening of vbs file through Windows Scheduler.

Go To Start > Control Panel > Schedule Tasks > Click Add Schedule Tasks Click Next on the screen. Click Browse and and select the .vbs file you just created. You will get this screen

Windows Scheduled Task Wizard

Windows Scheduled Task Wizard

Give a name to the task and select the frequency for performing the given tasks. For this demo we will select “One time only”

Select time & date

Select time & date

Select Start Time and Start Date. For this demo, select Start Time as current time+5 mins and Start date as todays date.

On the next screen, Enter “UserName”, “Password” and “Confirm Password” of your windows machine. Click Next and you should see this screen.

Scheduled Task Wizard Final Screen

Scheduled Task Wizard Final Screen

Click on Finish and yay, you’re done.

Note: The steps above are for Windows XP and may be different for other Operating Systems.

Please let us know your feedback and comments below.

If you want to keep track of further articles on UFT (QTP). I recommend you to subscribe by Email and have new UFT articles sent directly to your inbox.

Subscribe to get free updates on UFT!

LearnQTP is the most popular site on UFT (formerly QTP).

Enter your first name and email address below to instantly subscribe and download an eBook on Optimizing UFT Scripts. In future, we will make sure you get new tips & tricks on UFT delivered direct to your email box.

Please check your email and confirm free subscription!