In this article, we will learn all about Action Template in UFT. Where are they used? and Why are they used in UFT?
Say you want to include a piece of text every time you insert a new action. This piece of text can be VBScript statements or a part of documentation information like the date when the test was created, variables that are used by the test, history to maintain log of all the changes etc. Something like what is shown in image below:
UFT One/QTP does not provide any GUI controlled way to include a piece of text in every new action. However there is a roundabout way of doing this. Micro Focus calls it Action Template.
- Go to
<dat>
folder inside UFT One/QTP installation<UFT installation>\dat
folder. Normally it can be found underC:\Program Files\Mercury Interactive\QuickTest Professional\dat
for versions of QTP below 11 and underC:\Program Files (x86)\Micro Focus\Unified Functional Testing\dat
for UFT 11.0 or above. - Inside
<dat>
folder, create a file by the name ActionTemplate.mst Open it in notepad and include the information you would like to see whenever a new action is created. - Done. Insert a new action in UFT/QTP and see it working!
Do share your comments below if this has helped you increase productivity in UFT One/QTP.
If you like this quick tip and want more, do consider joining our renowned UFT training program.
If you want to keep track of further articles on UFT (QTP). I recommend you to subscribe by email below and have new UFT articles sent directly to your inbox.
Shyam says
is there any action template for BTP component? if so how to create that like ActionTemplate.mst
Dheeraj says
Hi Ankur
I created a mst file with name Automation Summary.mst , kept it in …\dat folder. We did not find any change in QTP new action. Then we changed the name to ActionTemplate.mst and it worked.
Can you please help me to understand why it is mandatory to keep the name as ActionTemplate.mst or it is just QTP convention.
Regards
Dheeraj
vasanth says
Hi friends,
Open the notepad->Type what ever u want->Go to File in the note pad->Select save as->enter the name with double colon “ActionTemplate”.
Then u paste dat folder..
🙂
Nilanjan says
Hi,
I created the file with ActionTemplate.mst in the dat folder as mentioned above , but when i opened the new action , i could not able to see the action template commented in qtp.., pls help me in this regard
Thanks
Nilanjan
vagdha says
hi ankur
am facing problm in saving mt action tempalte in dat folder can u help me?
srinivas says
While saving the file make sure that
File Name:ActionTemplate.mst
save as type :All Files
Rajesh says
hi,
i created the file with Action Template.mst in the dat folder, but when i opened the new action , i could not able to see the action template in qtp.., pls help me in this regard
Thanks
Rajesh
swagat says
hi i have done as per the specifications– created ActionTemplate.mst file inside the dat folder,, still i am not able to see my specific piece of code placed inside the ActionTemplate.mst in action..
I have used “A” and “T” as capital in ActionTemplate.mst.
I have placed that in C:\\ProgramFiles\HP\QuickTestProfessional\dat folder.
Please help me out.
sharath says
hi,
i created an :ActionTemplate.mst ” file but when i open a new action i dont see any text displayed please help me with this………….
thanks®ards,
sharath chandra
janani says
When ActionTemplate.mst file is saved in notepad, it is saved as ActionTemplate.mst.txt. So make sure that filename is correctly saved as ActionTemplate.mst.
Smita says
Good article
Raj Yaramala says
Its really cool
Mamatha says
Hi, I want to create new QTP script with multiple actions say 3 actions login, abc, logoff programmatically. Is it possible to do this.
i could create a script with one default action – Action 1 but not able to Rename the Action programatically and not able to add additional actions into it.
i want to do it in a VBS/macro. please help me.
Regards
Mamatha TR
Kavya says
Hi,
I created ActionTemplate.mst file in dat folder under C drive. But in QTP, when i click on New Test, i don’t see the default template. Please help me with this. Am i doing anything wrong here?
Thanks.
suresh says
Hi,
Thanks for the tip.
I have created the mst file but when an action is opened i could not see the format which i have used in the file.
koki says
hi i’m sorry ok i created ActionTemplate.mst in note pad. But the text is not displayed when i insert a new action. Please help me .
koki says
encore moi dsl mai ç amarche pas ce truc je vois r1 même si j’ai crée le fichier sous le nom ActionTemplate.mst mai je peux s’avoir s’il il y a d’autres settings à faire au niveau de qtp plz ????
Ankur says
@koki: Can you please write that in English?
koki says
merci Ankur ,pour la création c’est fait mais il y a pas d’autres “settings” à faire au niveau de QTP car ça marche pas ?! merci d’avance
Ritesh says
Hi Ankur,
i created ActionTemplate.mst in note pad. But still the text is not displayed when i insert a new action. Please help me regarding this.
Anees says
Hi Ankur,
Thankyou I am able to create Action Template.mst file.
and its working fine
Thanks
Anees
Ankur says
@anees – Yes, it gets inserted like comments. Check out the image above.
anees says
Hi Ankur, i am unable to create ActionTemplate.mst.actualy in dat folder i created ActionTemplate.mst in note pad .there in that file whether interms of comment i have to give or what plz help me regarding this i am unable to do that
brahma says
hi ankur now iam able to create the ActionTemaplate.mst file so u can ignore my request..
Thanks,
brahma
brahma says
hi ankur, iam facing problem with creating the ActionTemplate.mst file. will you help me to create the ActionTemplate.mst file