Smart Identification: 智能识别机制主要工作于测试脚本运行时(对象允许智能识别为真),当对象库中对象的强制属性(或辅助属性)与被测应用程序中对应对象的属性不一致时,智能识别机制将会启动。其主要原理为:先选择某个基本属性进行比较,若对象多于一个,再继续添加属性筛选;若添加的对象属性造成无对象匹配,则淘汰该属性,应用该方法直至找到唯一对象并对该对象执行操作。(若所有属性的添加或淘汰都无法识别唯一对象,QTP将应用ordinal identifier去识别对象。) 选中Enable Smart Identification选项,然后点击它右边的Configure按钮打开Smart Identification Properties对话框,框中列出基本Filter属性以及可选Filter属性。 选中某类的Enable Smart Identification选项,QTP在录制过程中就会获取该类对象的所有在Smart Identification Properties对话框中指定的属性值。 在默认情况下,有的类的Enable Smart Identification选项默认被选中,并设置好了Smart Identification。 只有选中了类的Enable Smart Identification选项,才通在测试过程中使用Smart Identification机制;假设你已经在Smart Identification Properties对话框中设置好了Smart Identification,你可能又不希望在测试过程中使用Smart Identification机制,在这种情况下,将该类的Enable Smart Identification选项清除即可。 注意:在Object Properties或Object Repository对话框,对于某些对象,可以禁止它们的SmartIdentification机制,即使你已在Object Identification窗口中选中了Enable Smart Identification选项。 但是,如果在Object Identification窗口中没有选中Enable Smart Identification选项,则测试过程中无法启用Smart Identification机制。 在测试中,你还可以在整个测试中禁止使用Smart Identification机制,操作在Test Setting对话框的Run页签中完成。 |
|
来自: 恋家的孩子 > 《vbscript》