How to create Action Template in UFT
What is Action Template?
When we create an automation script in UFT tool or any other tool, we write some kind of documentation such as the developer name, version, description of the file, the purpose of the file, etc. on top of each file. This practice helps the other developers to understand the script easily.
Action Template in UFT is a mechanism provided by UFT tool that allows you to include some text in your new actions by default. It means that the text(which you chose to include ) 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.
How to create action template in UFT
Let us suppose that you want to add the following text to your action in UFT–
'========================================================================= 'Action Name – 'Purpose – 'Created by – 'Date – 'Change History '========================================================================
Steps to create action template in UFT
- Open notepad and copy the above code to it. You can make some change if you want to. This is just text which you want in each action you create
- Save this file as ActionTemplate.mst
- Open UFT/QTP’s dat folder. For QTP 11, the path can be: C:\Program Files\HPQuickTest Professional\dat. [Note: The path can change depending upon the OS & QTP version/installation]
- Add the ActionTemplate.mst file in the dat folder.
- Now whenever you create a new action, you will see the above template pre-printed on top of the editor by default.