What about running them on the schedule, for example nightly testing?
I will show the way how to do that - i.e. how to run QTP tests from command line.
Using that approach, you can execute your QTP tests on the schedule.
How to run QTP test from command line - QTP video tutorial
This is a script, which runs QTP tests (from the above QTP video tutorial):
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
qtApp.Open "C:\Temp\simple_test", True ' Open the test in read-only mode
' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Run ' Run the test
WScript.StdOut.Write "Status is:" & qtTest.LastRunResults.Status ' Check the results of the test run
qtTest.Close ' Close the test
Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
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
qtApp.Open "C:\Temp\simple_test", True ' Open the test in read-only mode
' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Run ' Run the test
WScript.StdOut.Write "Status is:" & qtTest.LastRunResults.Status ' Check the results of the test run
qtTest.Close ' Close the test
Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
Happy QTP scripting, dear readers! :)
Related articles:
- How to capture dynamic text - QTP video
- How to record QTP script - video
- QTP - How to set/get system time and date?
- How to execute QTP script from LoadRunner?
- QTP - How to get font size/color, background color and other attributes of controls
- How to minimize/maximize QTP window before the QTP script execution?
- All QTP visual tutorials
Do you like this QTP visual tutorial? Would you like to receive them in the future?
If yes, please subscribe to this blog RSS feed or by Email. (How to subscribe? VIDEO guide)
40 comments:
Hi Dmitry Motevich,
Thanks a lot for ur videos. those are great for a starter like me. Ur blog site gives us lot of information n increases our knowledge in QTP.
A request please load the videos in a format so that we can download easily.
Please focus on Regular Expressions and Descriptive Programming a bit.
Thanks & Regards
Sheshadri
Thank you, Shashi, for your comment.
I have several questions on your request:
What video format do you ask?
What file server should I use to store video files?
Who will pay for this file server usage & big generated traffic?
I'm working on video tutorial about Descriptive Programming. So, it will be ready in 1 week.
As for Regular Expressions... This topic is explained on Internet widely. I do not plan to duplicate those articles.
hi
The code for QTP regarding running the script from commandling was very excellent . Can you please concentrate regarding the driver script and Recovery scenarios in the driver script. And how to connect and execute QTP Scripts from QC. Please be a little bit elaborate on this issue.
Any Help in this issue is highly appreciated.
Regards,
Vinesh.
Hi
Thanks for presenting such good contents on your blog. The content posted by you is very excellent. In further postings from your side we expect you to post postings related to Recovery scenarios and developing the driver script and running the QTP script from Quality center and posting the results back to Quality Center.
Regards,
Satyam Reddy
Thanks very much it was very useful.
2Khizer:
I'm glad to hear that!
Dear Dmitry,
It's wonderful video, but if you capture some more stuff such as how to capture checkpoint value, descriptive programming examples, parameterize value set up and merge two different scripts by function call that would be appreciated.
Thanks!
Nice job!! keep it up.
Deven
2Deven:
Thank you.
I will try to create QTP videos on others topics
Dmitry,
Thanks for this video,
This is very easy to understand.
I have a request: I am focusing on automating using QTP on a VMware image, The test application is written using Visual C++ and "Windows XP" running on VMware Do you have any details, whether QTP identifies Windows XP image? Please let me know.
2Sukanya:
What do you mean with "QTP identifies Windows XP image"?
What is "Windows XP image"?
Dmitry,
"Windows XP Image" is is the VMware supported file, (files of format .vmx), If this is opened using VMware, it works as virtual computer with windows xp installed in it.
Thanks,
2sukanya:
You didn't answer my another question.
Hey Dmitry...firstly I have to appreciate the time and effort you have taken to share your knowledge....you are doing a great job helping the community...keep it up !!!
2George:
Thank you, George.
hello,
Thanks you for the video. I use the command line to run my QTP tests using vbscript, however i would like to know if it's possible to run QTP tests with another language like Python...
Thanks. Your blog is very interesting.
to thomas_c (September 11),
The QuickTest automation object model supplies a type library file
named QTObjectModel.dll. This file is stored in 'QuickTest installation folder'\bin.
So, you can access QTP Automation COM object from different programming language. I'm sure that Python provides such possibilities.
Hi Dmitry,
This Video is preety good. Thanks for your effort. But if you will attach the Liberary Function files and Excel sheets to the script then do we need to write any mode code for the executing it?
please let me know for the same.
Best Regards,
Chaitanya Rajkiran
Chaitanya.jitm@gmail.com
to Raj (September 22),
I didn't get you at all.
What "Liberary Function files and Excel sheet" do you mean?
What is "mode code"?
hi
motevich
before watching ur vedio
i had one doubt how to use recovery scenario,now i understood how to do that,i watched ur vedio on recovery scenario its very good ,easy to understand,thanks a lot
Thank you so much for putting this video out there for everyone. It is a big help. I really appreciate the time and effort that you have put to make this so simple and easy to understand.
Thank you so much for putting this video out there for everyone. It is a big help. I really appreciate the time and effort that you have put to make this so simple and easy to understand.
@ sivakrishna & Rama,
Thank you, my dear readers :)
Great! That helps me a lot! Thank you very much!
Your blog is very good...
Please put more articles on Descriptive programming.
Or if you have time send it to
mail2lionel@yahoo.co.in
I recommend to subscribe to my blog and you will get all new published articles and videos
Thank You providing this information.
/Sri
How do I set up a parameter in the command line and get the parameter in VBScript?
I would like to set up some parameters to make the QTP Test run in different way.
How do I set up the parameters in the command line and how do I retrieve the parameters in the VBScript?
Many thanks for your replying.
Bset Regards,
Vincent
It was nice script
would like something that runs the same way on a remote machine ..is it possible ?
Hi Dmitry,
First of all...thank you for the time and effort you have put in...
when I run your script I get the following error:
Error: The server process could not be started because the configured identity is incorrect. Check the username and password.
Code: 8000401A
Any ideas how to solve it?
@Anonymous (February 18, 2009),
Answered above.
It's a pity that you didn't read above comments...
HiDimitry,
the script closes the test but keeps the QTP application open. Could you please tell how you can close the application. cos my results are saved in a location and i can go visit them.
@Anonymous (March 5, 2009),
qtApp.Quit
How To Run QTP Scripts at Scheduled Time?
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
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
Hi,
GREAT video, how do you schedule the task now?
Great Video!
Now how do you schedule the task? Do you run the vbs file from the scheduled task on windows?
Excellent!! You truly are an expert with this tool. I will always use this blog for all my QTP related queries. Thank you very much.
Regards,
Suresh.
Hi Dmitry
I am recording a dropdown box in my web application.I have to record all the options in the dropdown box and need to put a checkpoint on everylanding page.But the problem is when I try to record every optin individually the script gets too long.Is therea way that I can parameterize the option and the checkpoints.Please help me .Its urgent
regards
Sarika
Hi Dmitry
I need to record a drop down box in my web application.I need to put a check point for every landing page.Is there a we can parameterize the values of the check point .Because when I try to record each option individually from the dropdown box the script gets too long.Please help me its really urgent
regards
Jyotsana
Hi Dimitry
I was wondering how would I be able to open Tests that are not stored locally on my machine, e.g Test Director and Quality Center
Post a Comment