QTP測試指令碼的維護 - 使用Update執行模式和Maintenance執行模式

TIB發表於2010-01-10

Why Tests Fail 為什麼指令碼執行會失敗?

Tests fail when QuickTest encounters a step it cannot perform or the results of a step indicate failure. In many cases this is due to the application being tested not functioning properly. QuickTest then provides you with test results that assist you in understanding how to fix your application.

Sometimes a test fails because the application being tested has changed from when the test was created and the QuickTest test needs to be updated to reflect those changes. Your object repository may also be missing some of the objects it needs to run the test. QuickTest provides tools that help identify and resolve some of these issues.

·   Object Changes

·   Checkpoint Changes

通常是物件發生改變或者是檢查點發生了改變。這就帶來了測試指令碼維護的問題。在QTP中,可以使用Maintenance執行模式和Update執行模式來進行指令碼的自動化更新和維護。

 

Running Tests with the Maintenance Run Wizard

The Maintenance Run Wizard helps you to maintain your test when it encounters the following problems and provides the following solutions:

 

Problem

Solution

The step failed because the object in your test cannot be identified in the application.

The Maintenance Run Wizard helps you identify the object in the application that you want your test to use.

If you point to an object in the application being tested, the Maintenance Run wizard will compare that object to the objects in the associated object repositories.

Depending on how the property values of the object to which you point compare to the property values of the objects in the associated repositories, the Maintenance Run wizard will suggest one of a several options for updating your test to reflect the changes in the application.

You can also choose to add a comment to your test before the failed step.

The step failed because the object in your test is missing from your associated object repositories.

The Maintenance Run Wizard helps you add the missing object to the repository.

You can also choose to add a comment to your test before the failed step.

The object in your step exists in the application, but can be identified only through Smart Identification.

Identifying objects using Smart Identification may cause tests to run slower. (For more information see, Configuring Smart Identification.) The Maintenance Run Wizard helps you modify the description of the object, so that Smart Identification is not needed.

 

Maintenance執行模式主要解決物件識別導致的指令碼失敗的問題。

關於Maintenance執行模式可以觀看QTP10附帶的視訊(Help->Product Feature Movies->Maintenance Run Mode)。

 

 

Updating a Test Using the Update Run Mode Option

When you run a test in Update Run Mode, QuickTest runs the test to update the test object descriptions, the Active Screen images and values, and/or the expected checkpoint values. After you save the test, the updated data is used for subsequent runs.

You can specify one or more of the following information types to update:

Update test object descriptions. QuickTest updates the set of properties for each object class in your associated object repositories according to the properties currently defined in the Object Identification dialog box. You can use this option to modify the set of properties used to identify an object of a certain type.

Update checkpoint properties and output property values. QuickTest updates the expected values of your checkpoints to reflect any changes that may have occurred in your application since you created the test and updates the list of items that can be retrieved in your output value steps.

Update Active Screen images and values. QuickTest updates images and property values in the Active Screen to reflect any changes that may have occurred in your application since you recorded the test or if the Active Screen does not appear as it should. For example, suppose a dialog box in your application has changed since you recorded your test. You can update the test to update the dialog box appearance and its properties in the Active Screen.

 

使用Update執行模式可以在回放指令碼過程中更新測試物件描述、檢查點屬性和輸出屬性值、更新Active Screen

 

 

 

相關文章