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.
通常是对象发生改变或者是检查点发生了改变。这就带来了测试脚本维护的问题。在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:
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。