chandrika_1

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2008-11-25
15:39
1726 views
Hi,
Can anyone please help me. I have my QTP script i want to run everyday at a set time.
Thanks
Rik
Can anyone please help me. I have my QTP script i want to run everyday at a set time.
Thanks
Rik
1 Solution
Accepted Solutions


Absent Member..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2008-11-25
22:10
Hi Rik,
You can use "Scheduled Tasks" to launch QTP and run your script. Look under Start>Programs>Accessories>System Tools...
A command line like this should do the trick:
"C:\Program Files\HP\QuickTest Professional\bin\cmdrv" -usr "C:\Documents and Settings\Clark\Desktop\Examples and Corrections\Booo ya\Booo ya.usr"
Make sure you get right down to the ".usr" file.
Please post how it goes,
Thanks,
Ed
You can use "Scheduled Tasks" to launch QTP and run your script. Look under Start>Programs>Accessories>System Tools...
A command line like this should do the trick:
"C:\Program Files\HP\QuickTest Professional\bin\cmdrv" -usr "C:\Documents and Settings\Clark\Desktop\Examples and Corrections\Booo ya\Booo ya.usr"
Make sure you get right down to the ".usr" file.
Please post how it goes,
Thanks,
Ed
7 Replies


Absent Member..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2008-11-25
22:10
Hi Rik,
You can use "Scheduled Tasks" to launch QTP and run your script. Look under Start>Programs>Accessories>System Tools...
A command line like this should do the trick:
"C:\Program Files\HP\QuickTest Professional\bin\cmdrv" -usr "C:\Documents and Settings\Clark\Desktop\Examples and Corrections\Booo ya\Booo ya.usr"
Make sure you get right down to the ".usr" file.
Please post how it goes,
Thanks,
Ed
You can use "Scheduled Tasks" to launch QTP and run your script. Look under Start>Programs>Accessories>System Tools...
A command line like this should do the trick:
"C:\Program Files\HP\QuickTest Professional\bin\cmdrv" -usr "C:\Documents and Settings\Clark\Desktop\Examples and Corrections\Booo ya\Booo ya.usr"
Make sure you get right down to the ".usr" file.
Please post how it goes,
Thanks,
Ed


Absent Member..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2008-11-26
06:11
Hi..
Do you use TD for QC as well.?
If yes....then you can schedule the test runs from Test lab module.
Warm Regards,
Shivaram
Do you use TD for QC as well.?
If yes....then you can schedule the test runs from Test lab module.
Warm Regards,
Shivaram
chandrika_1

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2008-11-26
12:40
Hi shivaram,
Actually we don't have QC & TD. So, actually i am trying to use windows scheduler to perform this task.
Thanks
Rik
Actually we don't have QC & TD. So, actually i am trying to use windows scheduler to perform this task.
Thanks
Rik
chandrika_1

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2008-11-26
12:46
Hi Ed,
Thanks for your response. actually i have tried running my script thru windows scheduler, But In the set time it is not able to open My QTP script. The error i am getting is browser error. like you said about the .usr file, should i use this in scheduler window. Can you please briefly explain about the command line which you had sent me.
Thanks
Rik
Thanks for your response. actually i have tried running my script thru windows scheduler, But In the set time it is not able to open My QTP script. The error i am getting is browser error. like you said about the .usr file, should i use this in scheduler window. Can you please briefly explain about the command line which you had sent me.
Thanks
Rik


Absent Member..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2008-11-26
13:16
Sure Rik. You can test the command line I sent at the CMD prompt. So, Start>Run, type "cmd" (no quotes) and click okay. At the black "CMD" window that appears you can paste the command. Of course you will want to verify the path on your machine for the first part (the "HP" might be might be "Mercury Interactive" for example) and you'll also need to modify the second part to indicate a ".usr" file from an existing script on your system.
So, once you validate that your whole command line works in that window, in theory you should be able to use it in the scheduler.
Here are some other things you can try:
Another method:
ExecuteTest "C:\TestOne"
ExecuteTest "C:\TestTwo"
Public Sub ExecuteTest(TestPath)
Dim qtpApp
Dim qtpTest
Set qtpApp = CreateObject("QuickTest.Application")
qtpApp.Open TestPath, True
Set qtpTest = qtpApp.Test
qtpTest.Run
While qtpTest.IsRunning
'Wait For Test To Finish
Wend
qtpTest.Close
Set qtpTest = Nothing
qtpApp.Quit
Set qtpApp = Nothing
End Sub
One more:
1. QTP 9.2 has the ability to generate the code to run QTP Script using command line automatically. For that Goto File > Setting and click on "Generate Script" button. and then save the script in a .vbs file.
Before running the .vbs file simple add the below two lines of code in it
App.Open "F:\QTPTests\Test3\" 'Specify appr. qtp test path
App.Test.Run ,True
2. For storing the QTP Test Results in your specified path, use the below code.
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtResultsOpt.ResultsLocation = "C:\MyTest\Test1"
qtTest.Run qtResultsOpt
Hope one of the above works for you. Please post how it goes - and don't forget to assign points for helpful suggestions.
🙂
Ed
So, once you validate that your whole command line works in that window, in theory you should be able to use it in the scheduler.
Here are some other things you can try:
Another method:
ExecuteTest "C:\TestOne"
ExecuteTest "C:\TestTwo"
Public Sub ExecuteTest(TestPath)
Dim qtpApp
Dim qtpTest
Set qtpApp = CreateObject("QuickTest.Application")
qtpApp.Open TestPath, True
Set qtpTest = qtpApp.Test
qtpTest.Run
While qtpTest.IsRunning
'Wait For Test To Finish
Wend
qtpTest.Close
Set qtpTest = Nothing
qtpApp.Quit
Set qtpApp = Nothing
End Sub
One more:
1. QTP 9.2 has the ability to generate the code to run QTP Script using command line automatically. For that Goto File > Setting and click on "Generate Script" button. and then save the script in a .vbs file.
Before running the .vbs file simple add the below two lines of code in it
App.Open "F:\QTPTests\Test3\" 'Specify appr. qtp test path
App.Test.Run ,True
2. For storing the QTP Test Results in your specified path, use the below code.
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtResultsOpt.ResultsLocation = "C:\MyTest\Test1"
qtTest.Run qtResultsOpt
Hope one of the above works for you. Please post how it goes - and don't forget to assign points for helpful suggestions.
🙂
Ed
chandrika_1

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2008-11-26
18:41
Hi Ed,
Thank you so much. I was able to run it. like the following. Now can i ask you another question? after my scheduler is running the test how can i see my test result.I really appreciate all of your help & being patience with me.
Thank
Rik
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\HP\QuickTest Professional\Tests\mytest", False 'Opens the test in editable mode
------
Dim Test_path
Test_path = "C:\Program Files\HP\Quicktest Professional\tests\mytest"
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible
' Set QuickTest run options
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False
qtApp.Open Test_path, True ' Open the test in read-only mode
' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Run ' Run the test
qtTest.Close ' Close the test
qtApp.quit
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
Thank you so much. I was able to run it. like the following. Now can i ask you another question? after my scheduler is running the test how can i see my test result.I really appreciate all of your help & being patience with me.
Thank
Rik
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\HP\QuickTest Professional\Tests\mytest", False 'Opens the test in editable mode
------
Dim Test_path
Test_path = "C:\Program Files\HP\Quicktest Professional\tests\mytest"
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible
' Set QuickTest run options
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False
qtApp.Open Test_path, True ' Open the test in read-only mode
' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Run ' Run the test
qtTest.Close ' Close the test
qtApp.quit
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
chandrika_1

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2008-11-26
20:38
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\HP\QuickTest Professional\Tests\mytest", False 'Opens the test in editable mode
------
Dim Test_path
Test_path = "C:\Program Files\HP\Quicktest Professional\tests\mytest"
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible
' Set QuickTest run options
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False
qtApp.Open Test_path, True ' Open the test in read-only mode
' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Run ' Run the test
qtTest.Close ' Close the test
qtApp.quit
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
App.Launch
App.Visible = True
App.WindowState = "Maximized" ' Maximize the QuickTest window
App.ActivateView "ExpertView" ' Display the Expert View
App.open "C:\Program Files\HP\QuickTest Professional\Tests\mytest", False 'Opens the test in editable mode
------
Dim Test_path
Test_path = "C:\Program Files\HP\Quicktest Professional\tests\mytest"
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible
' Set QuickTest run options
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False
qtApp.Open Test_path, True ' Open the test in read-only mode
' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Run ' Run the test
qtTest.Close ' Close the test
qtApp.quit
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object