SOFTWARE TESTING: How To Run QTP Scripts at Scheduled Time?

Thursday, October 20, 2011

How To Run QTP Scripts at Scheduled Time?

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.
1) 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

2) 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 3) 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.
4) Click Browse and and select the .vbs file you just created.You will get this screen

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

6) Select Start Time and Start Date. For this demo, select Start Time as current time+5 mins and Start date as todays date.
7) Next Screen Enter "UserName", "Password" and "Confirm Password" Click Next and you should get this screen.
8) Click on Finish and yay, you're done.
Note: The steps above are for Windows XP and may be different for other Operating Systems.

1 comment:

  1. Hi,
    suppose we are using two different sets of test cases means how can we handle the time to start another execution.because first execution take some buffer time means its lead to extra execution time from expected.it may affect second execution .how can we handle this?
    Test Automation

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...