[23] QTP study No.8_Checking Objects

來源:互聯網
上載者:User
2007/11/14 16:51

Checking Objects

In this section, you will add a standard checkpoint in the Book a Flight page. This checkpoint verifies the value in the box containing the first name of the passenger.

1.     Start QuickTest and open the Recording test.

If QuickTest is not already open, choose Start > Programs > QuickTest Professional > QuickTest Professional.

o    If the Welcome window opens, click Open Existing.

o    If QuickTest opens without displaying the Welcome window, choose File > Open > Test or click the Open button down arrow and choose Test.

In the Open Testdialog box, locate and select the Recording test, then click Open.

2.     Save the test as Checkpoint.

Choose File > Save As. Save the test as Checkpoint.

3.     Confirm that the Active Screen option is enabled.

If you do not see the Active Screen at the bottom of the QuickTest window, click the Active Screen button or choose View > Active Screen.

4.     Locate the page where you want to add a standard checkpoint.

You want to add a checkpoint that checks the property values of the First Name edit box after the passenger's name has been entered in the box.

In the Item column of the Keyword View, expand Action1 > Welcome: Mercury Tours.

Highlight the Book a Flight: Mercury row. The Book a Flight page is displayed in the Active Screen and the object corresponding to the selected step is highlighted. You can see that the passenger's first name is displayed in the First Name box.

5.     Create a standard checkpoint.

In the Active Screen, right-click the First Name boxand choose Insert Standard Checkpoint. The Object Selection – Checkpoint Properties dialog box opens.

Confirm that WebEdit: passFirst0 is highlighted, and click OK.

The Checkpoint Properties dialog box opens.

                         The dialog box displays the object's properties:

o    The Name is the name of the object as defined in the HTML code of the Web page.

o    The Class is the type of object. WebEdit indicates that the object is an edit box.

o    The ABC icon in the Type column indicates that the value of the property is a constant.

For each object class, QuickTest recommends default property checks. The table below describes the default checks for the WebEdit class.

Property

Value

Explanation

html tag

INPUT

INPUT is the html tag as defined in the HTML source code.

innertext

In this case, the value of innertext is empty. The checkpoint checks that the value is empty.

name

passFirst0

passFirst0 is the name of the edit box.

type

text

text is the type of object as defined in the HTML source code.

value

<FirstName>

(The name you entered while recording)

The value entered in the edit box.

The passenger's first name is entered in the First Name box when the passFirst0 Set... step is performed. Therefore, in the Insert statement area of the Checkpoint Properties dialog box, select After current step. This inserts the checkpoint after the passFirst0 Set... step in which the first name is entered.

In the Name box, enter CheckName as the new checkpoint name.

Accept the rest of the settings as default and click OK. QuickTest adds a standard checkpoint step to your test below the selected step.

6.     Save the test.

Choose File > Save or click the Save button .

You insert most checkpoints in the manner described above. Several special types of checkpoints are explained in the following sections.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.