【转载】Why Tests Fail 为什么脚本运行会失败?

上一篇 / 下一篇  2010-04-06 21:34:31 / 个人分类:QTP

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:

1.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.
 
2.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.
 
3.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。


TAG:

 

评分:0

我来说两句

Open Toolbar