.

How to include an Action template in new action automatically?

This is an article from Naveen Nischal, India. He will discuss a quick but important tip which can potentially save a lot of documentation time.

Say you want to include a piece of text every time you insert a new action. This piece of text can be some VBScript statements or a part of documentation information like date when the test was created, variables that are used by the test, change history to maintain log of all the changes etc. Something like what is shown in image below:

action-template

QTP does not provide any out-of-the-box way to include a piece of text -template- in every new action.  However there is a roundabout way of doing this. We will call it as Action Template.

  1. Go to <dat> folder inside QuickTest Professional installation. Normally it can be found under C:\Program Files\Mercury Interactive\QuickTest Professional\dat
  2. 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.
  3. Done. Insert a new action in QTP and see it working!

Thanks Naveen. I’m sure our blog readers will like this tip.

Like Naveen, If you also want to share any QTP tips with the QTP community, do let me know through the contact form.

Have you downloaded the FREE Optimizing QTP eBook yet? Get It Now!

If you want to keep track of further articles on QTP. I recommend you to subscribe via RSS feed. You can also subscribe by Email and have new QTP articles sent directly to your inbox.

Related posts:

  1. In case your QTP crashes frequently… check this out…

16 comments ↓

#1 brahma on 04.13.09 at 19:44

hi ankur, iam facing problem with creating the ActionTemplate.mst file. will you help me to create the ActionTemplate.mst file

#2 brahma on 04.13.09 at 22:17

hi ankur now iam able to create the ActionTemaplate.mst file so u can ignore my request..

Thanks,
brahma

#3 anees on 04.16.09 at 05:08

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

#4 Ankur on 04.16.09 at 05:37

@anees – Yes, it gets inserted like comments. Check out the image above.

#5 Anees on 04.19.09 at 02:30

Hi Ankur,
Thankyou I am able to create Action Template.mst file.
and its working fine

Thanks
Anees

#6 Ritesh on 04.25.09 at 05:47

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.

#7 koki on 04.27.09 at 01:51

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

#8 koki on 04.27.09 at 06:51

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 ????

#9 Ankur on 04.27.09 at 20:43

@koki: Can you please write that in English?

#10 koki on 04.28.09 at 00:49

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 .

#11 suresh on 04.28.09 at 11:10

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.

#12 Kavya on 05.18.09 at 12:46

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.

#13 Mamatha on 06.11.09 at 18:08

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

#14 Raj Yaramala on 06.17.09 at 05:25

Its really cool

#15 Smita on 07.31.09 at 02:17

Good article

#16 janani on 04.01.10 at 21:25

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.

Leave a Comment