[20] QTP study No.5_Analyzing the Test in the Keyword View

2007/11/01 14:01

Analyzing the Test in the Keyword View

As you recorded your test, QuickTest generated steps in the Keyword View representing each operation you performed in the Web browser.

The columns in the Keyword View show different information for each step, as follows:

·         Item. The item for the step (test object, utility object, function call, or statement) in a hierarchical icon-based tree.

·         Operation. The operation to be performed on the item, for example, Click or Select.

·         Value. The argument values for the selected operation, for example, the mouse button to use when clicking the image.

·         Documentation. Auto-documentation of what the step does, in an easy-to-understand sentence, for example, Click the "findFlights" image.

·         Assignment. The assignment of a value to or from a variable so you can use the value later in the test. This column is not visible by default.

·         Comment. Any textual information you want to add regarding the step, for example, Return to page used in first step of the test. This column is not visible by default.

Note: You can choose to hide or display individual columns as required, by right-clicking the column heading in the Keyword View and selecting a column name from the list.

In the Item column of the Keyword View, you can click the branch arrows to expand or collapse the steps under each Web page. You can expand the entire test by choosing View > Expand All.

When you expand your test, it should look similar to this:

For every step performed on an object, QuickTest displays a row in the Keyword View with an icon and details of the step. For example, the step below instructs QuickTest to click the reserveFlights image at a specific location in the Select a Flight: Mercury page of the Mercury Tours Web site.

The table below provides an explanation of the first few steps shown in the test in the Keyword View above.


2007/11/01 16:08

分析Keyword View视图中的测试脚本

脚本录制成功后,Quick Test会在将所有的操作步骤记录到Keyword View视图。

Keyword View视图中提供了很多栏目来显示每个步骤的相关信息。如下所示:

·         Item. 以阶层式结构显示每个步骤的图标(测试对象(test object),组件(utility object),函数调用(function call)以及声明(statement))。

·         Operation. 各个步骤所执行的操作,如Click或者Select

·         Value. 执行操作时的对象值,如点击图片时所使用的鼠标点击是左击还是右击。

·         Documentation. 自动生成的文档,用于简单记录每步操作的动作,如‘Click the "findFlights" image’。

·         Assignment. 显示脚本录制或回放后期可用到的变量值。Assignment栏在Quick Test默认情况下不显示。

·         Comment. 显示任何用户输入的与该步骤相关的文本信息,如‘Return to page used in first step of the test’。Comment栏在Quick Test默认情况下不显示。

注意:你可以根据需求隐藏或者显示各栏目,右击显示栏的标题就可以查看到所有栏目的名称,勾选名称则可以在Keyword View视图中显示。

Item栏中,点击下三角符号可以展开或者收缩各Web页面下的所有步骤。也可以通过点击View > Expand All来展开所有的步骤。(还可以点击键盘上的*键快速展开所有步骤)

所有步骤展开后,大致如下图所示:

对于对象的各个步骤,QuickTestKeyword View视图中提供了一行来显示所有的相关信息。例如 For example, the step below instructs QuickTest to click the reserveFlights image at a specific location in the Select a Flight: Mercury page of the Mercury Tours Web site.

下表列出了Keyword View 视图中部分脚本第一列标识的详细说明:

posted @ 2008-03-18 15:50  Atine  阅读(266)  评论(1编辑  收藏  举报