QTP的Action模板

TIB發表於2010-01-19

在QTP的安裝目錄,例如C:/Program Files/HP/QuickTest Professional/dat,建立一個名為ActionTemplate.mst的檔案,檔案中寫模板內容,例如:
' -----------------------------------------------------------
' Author:
' Create Date:
' Revision:
' -----------------------------------------------------------

 

儲存後,啟動QTP,這樣每次建立的Action都會包含模板中的內容。

除了在模板中寫註釋頭資訊外,還可以把一些每個Action都需要載入的函式或語句都寫上,例如寫入ExecuteFile語句載入VBS檔案。

If you want to include one or more statements in every new action in your test, you can create an action template. For example, if you always enter your name as the author of an action, you can add this comment line to your action template. An action template applies only to actions created on your computer.

To create an action template:

Create a text file containing the comments, function calls, and other statements that you want to include in your action template. The text file must be in the structure and format used in the Expert View.
Save the text file as ActionTemplate.mst in your <QuickTest Installation Folder>/dat folder. All new actions you create contain the script lines from the action template.
Note: Only the file name ActionTemplate.mst is recognized as an action template.

 

相關文章