Did you ever thought of including some predefined statements in every new test inside your QTP software?
If your answer is yes, then please read on.
You can accomplish this through Action Templates.
Let me present a very simple example to clear this. You want to get your name as the Author of the Action in every new test which means on opening a new test, your name would be displayed by default.
A sample template would be like:
'***********************************************************************
'@Author:
'@Name:
'@Description:
'***********************************************************************
You will notice that above shown template is fully commented out. Also, the Action Template applies to all the actions created on your own computer.
Now lets see how do we create an Action Template inside HP Quicktest Professional(QTP).
Creating Action Template inside HP QTP:
Open the notepad application and copy the above mentioned code inside the notepad. Save the file with this name “ActionTemplate.mst”. Please take care of adding the double quotes while saving the file in the Save as dialog box. Navigate to the path where your Quicktest Professional software is installed. Search for a “dat” folder inside it and save the above mentioned file inside the “dat” folder.
The hierarchy would be
After saving this file all new actions would contain the script lines from the Action Template saved just now.
Note that only the name “ActionTemplate.mst” would be recognized as an action template. It means if you change the file name to “ActionTemplate1.mst”, it would not work.
QTP VBScript new series + Interview Question Bank on QTP for enrichment of Knowledge in QTP
This Site has been brought to you by HP Certified Expert of QTP.
Exciting new articles for October:
1) QTP Tip:Deselect all Radio Buttons
2) HP QTP Crypt Object
3)Adding Hyperlinks in Excel Spreadsheet
Best of Luck Friends ! ! !
Expert QTP
expert.qtp@gmail.com
All Articles are Copyright Protected. These are Free for Reading & Personal Use. Reproduction in Any Form without the Permission is Illegal & Strictly Prohibited.
Copyright © 2009 ExpertQTP
Google Search
Sunday, February 15, 2009
Creating Action Template in HP QuickTest Professional QTP
Subscribe to:
Post Comments (Atom)
5 comments:
good one
Hi,
It did not work for me. I created ActionTemplate.mst file and saved it under QuickTest Professional\dat.
When i open QTP, when i click on "New Test" option, i didn't see the default template. Please help me with this.
Thanks.
Thanks
Hi Nice one
Hi,
For me also it did't work. Pls help.
Thanks,
VJ
Post a Comment