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