Qtp 简明教程
QTP - Actions
操作可帮助测试员将脚本划分为 QTP 语句组。操作类似于 VBScript 中的函数,但是有一些不同点。默认情况下,QTP 使用一个操作创建测试。
Actions helps testers to divide scripts into groups of QTP statements. Actions are similar to functions in VBScript; however, there are a few differences. By default, QTP creates a test with one action.
Actions |
Functions |
Action is an in-built feature of QTP. |
VBScript Functions are supported by both VBScript and QTP. |
Actions parameters are passed by value only. |
Function parameters are passed either by by value or by ref. |
Actions have extension .mts |
Functions are saved as .vbs or .qfl |
Actions may or may not be reusable. |
Functions are always reusable. |
可以通过右键单击脚本编辑器窗口并选择“属性”,访问操作的属性。
The properties of the action can be accessed by right clicking on the Script Editor Window and selecting "Properties".
操作属性包括以下信息-
Action properties contains the following information −
-
Action Name
-
Location
-
Reusable Flag
-
Input Parameters
-
Output Parameters
Types of Actions
共有三种类型的操作-
There are three types of actions −
-
Non-reusable action − An action that can be called only in that specific test in which it has been designed and can be called only once.
-
Reusable action − An action that can be called multiple times, any test in which it resides, and can also be used by any other tests.
-
External Reusable action − It is a reusable action stored in another test. External actions are read-only in the calling test, but it can be used locally with the editable copy of the Data Table information for the external action.
Working with Actions
有三种方法来插入操作。单击其中任何一个了解更多有关所选操作类型的信息。
There are three options to insert an action. Click on each one of those to know more about the selected type of action.
Sr.No. |
Action Type & Description |
1 |
Insert Call to New ActionInserts a New Action from the existing action |
2 |
Insert Call to Copy of ActionInserts a copy of an existing action |
3 |
Insert Call to Existing ActionInserts a call to existing re-usable action |