site
stats
By Anish Pillai Anish Pillai Posted under Not So Common Stuff | QTP Concepts

What is Action Template in QTP?

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×

Action Template is a mechanism in QTP that allows you to include some text in your new actions by default. The text will be included automatically every time you create a new action. Suppose that for every action you create for your automation suite, you want to include some comments at the beginning of the action. Instead of manually adding it for every action, you can create an Action Template that would automatically add the static text for you. Let us suppose that you want to add the following text in your action –


'=========================================================================
'Action Name -
'Purpose -
'Created by -
'Date -


'Change History
'- - - - - - - - - - - - - -
'Date Changed by Comments
'
'=========================================================================

Let’s see how this can be done –

1. Open notepad and copy the above code to it.

2. Save the notepad as ActionTemplate.mst.

3. Open QTP’s dat folder. For QTP 11, the path can be: C:\Program Files\HP\QuickTest Professional\dat. [Note: The path can change depending upon the OS & QTP version/installation]

4. Add the ActionTemplate.mst file in the dat folder. Thats All !!!

 

Open QTP and insert a new action. The new action should display the statements that you had saved in the Action Template.

Action Template in QTP

Action Template in QTP

Even after adding ActionTemplate.mst file in dat file, you new Action doesn’t display anything?

Now this is a very common problem faced by many people. And the primary reason for this is the extension of your Action Template file. Many a times when we create an ActionTemplate file using notepad, it gets saved as ActionTemplate.mst.txt. To make sure that this doesn’t happen – Open any folder, go to Tools -> Folder Options -> View (tab) & and deselect Hide extensions for known file types option. Check the extension of your Action Template file once again. Verify that the file is saved as ActionTemplate.mst only and not ActionTemplate.mst.txt

 

If you enjoyed this article, you can join our blog to get free email updates directly in your inbox.

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×
  • Abhishek

    This is a super post. I was not getting the ActionTemplate correct but with the section "Even after adding ActionTemplate.mst file in dat file, you new Action doesn’t display anything?" i have got it correct.
    Super work

    • Anish10110

      Thanks Abhishek.. 🙂 🙂 I'm glad it worked for you… Keep visiting… 🙂

  • derekg

    For anyone creating QTP tests using the QuickTest Add-in For Quality Center – something similar can be achieved by editing the Action Template file

    C:\Program Files\HP\QuickTest Add-in For Quality Center\bin\Templates\Template10\Action1\Script.mts

    Add to this file the desired code or comments to be added to the script during conversion from manual to QUICKTEST_TEST in QC.

    Also, to disable autogeneration of dummy steps for each manual step in the TC you can blank the contents of this file:

    C:\Program Files\HP\QuickTest Add-in For Quality Center\bin\Templates\ManualTemplate.txt

  • Apoorva

    Thank You so much..worked for me!!

    • Anish10110

      Cool.. 🙂

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×