51Testing软件测试论坛

标题: mandamoty properties,assistive properties ,smart identification的区别 [打印本页]

作者: 隐形人    时间: 2008-3-4 11:32
标题: mandamoty properties,assistive properties ,smart identification的区别
object identify 中的mandamoty properties,assistive properties ,smart identification都是用来帮助qtp来识别唯一的对象的,但是他们有什么区别吗?最好可以有个例子说明一下
作者: hsjzfling    时间: 2008-3-4 17:06
应该还要加上一个Ordinal identifier~这些其实就是关系到QTP如何依据当前代码与对象库,从程序中找到相应的对象。
顾名思义,mandatory properties为强制识别属性,是对象的最主要的识别属性;
assistive properties 为辅助识别属性,即当通过mandatory properties若不能找到唯一的对象,则依据assistive properties来识别对象;
这样若还不能确定一个唯一的对象,则依据Ordinal identifier来识别;
假若通过mandatory properties,assistive properties 与Ordinal identifier都没能找到匹配的对象,则此时smart identification开始起作用咯,若它为True,即启用智能识别,那么QTP开始在Basic Filter Properties符合条件的对象中"智能"的依照Optional Filter Properties中的属性匹配一个对象作为最终寻找的结果(PS:但一般这个结果都不是我们想要的......;) )

以上仅为个人理解,而非官方标准答案~~
感觉编辑后还是不完善,逻辑要再整理下,需要试验以后才能再说~看来自己理解的也还不够透彻

[ 本帖最后由 hsjzfling 于 2008-3-4 18:59 编辑 ]
作者: hsjzfling    时间: 2008-3-4 17:21
貌似我2楼说的有点问题,编辑下~~
作者: beiyu95    时间: 2008-3-4 17:28
给个官方的说明:
In addition to learning the mandatory and assistive properties specified in the Object Identification dialog box (Tools > Object Identification), QuickTest can also learn a backup ordinal identifier for each test object. The ordinal identifier assigns the object a numerical value that indicates its order relative to other objects with an otherwise identical description (objects that have the same values for all properties specified in the mandatory and assistive property lists). This ordered value enables QuickTest to create a unique description when the mandatory and assistive properties are not sufficient to do so.

Because the assigned ordinal property value is a relative value and is accurate only in relation to the other objects displayed when QuickTest learns an object, changes in the layout or composition of your application page or screen could cause this value to change, even though the object itself has not changed in any way. For this reason, QuickTest learns a value for this backup ordinal identifier only when it cannot create a unique description using all available mandatory and assistive properties.

In addition, even if QuickTest learns an ordinal identifier, it will use it during the run session only if the learned description and the Smart Identification mechanism are not sufficient to identify the object in your application. If QuickTest can use other test object properties to identify the object during a run session, the ordinal identifier is ignored.
作者: 隐形人    时间: 2008-3-5 18:26
整理下楼上所有同志的观点:
to  hsjxfling:依据你的观点,我可以把所有的属性全都定义在mandatory properties,因为mandatory properties是首先的属性,你并没有说明某些属性不能放在mandatory properties是情况.别外,依据beiyu95提供的官方文档,你的顺序可能要重新排一下:mandatory properties->assistive properties -->Smart Identification ->ordinal identifier
(原文:In addition, even if QuickTest learns an ordinal identifier, it will use it during the run session only if the learned description and the Smart Identification mechanism are not sufficient to identify the object in your application.)

谢谢大家的回复~~~
作者: hanxing0304    时间: 2009-5-1 16:36
QuickTest has a predefined set of properties that it learns for each test
object. If these mandatory property values are not sufficient to uniquely
identify an object you record or add, QuickTest can add some assistive
properties and/or an ordinal identifier to create a unique description.

Mandatory properties are properties that QuickTest always learns for a
particular test object class.
Assistive properties are properties that QuickTest learns only if the
mandatory properties that QuickTest learns for a particular object in your
application are not sufficient to create a unique description. If several
assistive properties are defined for an object class, then QuickTest learns one
assistive property at a time, and stops as soon as it creates a unique
description for the object. If QuickTest does learn assistive properties, those
properties are added to the test object description.

Note: If the combination of all defined mandatory and assistive properties is
not sufficient to create a unique test object description, QuickTest also
learns the value for the selected ordinal identifier.

When you run a test, QuickTest searches for the object that matches the
description it learned (without the ordinal identifier). If it cannot find any
object that matches the description, or if it finds more than one object that
matches, QuickTest uses the Smart Identification mechanism (if enabled) to
identify the object. In many cases, a Smart Identification definition can help
QuickTest identify an object, if it is present, even when the learned
description fails due to changes in one or more property values. The test
object description is used together with the ordinal identifier only in cases
where the Smart Identification mechanism does not succeed in narrowing
down the object candidates to a single object.

You use the Object Identification dialog box (Tools > Object Identification)
to configure the mandatory, assistive, and ordinal identifier properties that
QuickTest uses to learn descriptions of the objects in your application, and
to enable and configure the Smart Identification mechanism.
The Object Identification dialog box also enables you to configure new
user-defined classes and map them to an existing test object class so that
QuickTest can recognize objects from your user-defined classes when you
run your test.




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2