2、Understanding How QuickTest Identifies Objects During the Run Session

  了解 QuickTest 如何在运行会话过程中标识对象

  QuickTest also uses a very human-like technique for identifying objects during the run session.

  在运行会话期间,QuickTest 也会像人那样采用类似的技术来标识对象。

  Suppose as a continuation to the experiment, Jonny is now asked to identify the same "item" he initially identified but in a new, yet similar environment.

  假定继续该实验,现在 Jonny 需要在一个新的、但仍然相似的环境中识别出同一个“项目”。

  The first photograph he is shown is the original photograph. He searches for the same caucasian girl, about eight years old, with long, brown hair that he was asked to remember and immediately picks her out. In the second photograph, the children are playing on the playground equipment, but Jonny is still able to easily identify the girl using the same criteria.

  他所看到的第一张图片是原来的图片。他需要找出原来要求他记住的这个相同的留着褐色长发、大约 8 岁的白种女孩,并能立即指出这个女孩。在第二张图片中,这些孩子们正在操场设备上玩,但 Jonny 仍然能够使用相同的条件很容易地识别出这个女孩。

  Similarly, during a run session, QuickTest searches for a run-time object that exactly matches the description of the test object it learned while recording. It expects to find a perfect match for both the mandatory and any assistive properties it used to create a unique description while recording. As long as the object in the application does not change significantly, the description learned during recording is almost always sufficient for QuickTest to uniquely identify the object. This is true for most objects, but your application could include objects that are more difficult to identify during subsequent run sessions.

  同样,在运行会话期间,QuickTest 也会搜索与录制时记住的测试对象的描述完全匹配的运行时对象。它需要找到与录制时用于创建描述的强制属性和任何辅助属性完全匹配的对象。只要应用程序中的对象没有较大的改变,录制过程中记住的描述几乎总是足以使 QuickTest 标识出该对象。对于大部分对象,这种方法是适用的,但应用程序中包含的某些对象可能在后续运行会话期间很难标识。

  Consider the final phase of Jonny's experiment. In this phase, the tester shows Jonny another photograph of the same family at the same location, but the children are older and there are also more children playing on the playground. Jonny first searches for a girl with the same characteristics he used to identify the girl in the other pictures (the test object), but none of the caucasian girls in the picture have long, brown hair. Luckily, Jonny was smart enough to remember some additional information about the girl's appearance when he first saw the picture the previous week. He is able to pick her out (the run-time object), even though her hair is now short and dyed blond.

  考虑 Jonny 实验中的后一个阶段。在该阶段中,测试者向 Jonny 展示了另一张图片,同一个家庭在同一个位置,但孩子们都长大了,并且还有许多孩子正在操场上玩。Jonny 首先会通过与他用来在其他图片中识别出这个女孩(测试对象)的相同的特征来查找这个女孩,但图片中并没有留着褐色长发的白种女孩。不过很幸运,在上周第一次看到图片时,聪明的 Jonny 还记住了有关这个女孩外貌的其他一些信息。即使现在女孩的头发剪短了,并染成了金色,他仍然能够指出这个女孩(运行时对象)。

  How is he able to do this? First, he considers which features he knows he must find. Jonny knows that he is still looking for a caucasian female, and if he were not able to find anyone that matched this description, he would assume she is not in the photograph.

  他是怎么做到的呢?首先,他会考虑哪些特征是他必须找到的。Jonny 知道他仍要查找一个白种的女性,如果他找不到任何与该描述匹配的人,那么他将假定她不在图片中。

  Once he has limited the possibilities to the four caucasian females in this new photograph, he thinks about the other characteristics he has been using to identify the girl—her age, hair color, and hair length. He knows that some time has passed and some of the other characteristics he remembers may have changed, even though she is still the same person.

  将可能性限制为新图片中的四个白种女性后,他会考虑曾用于识别这个女孩的其他特征 - 她的年龄、头发的颜色和头发的长度。他知道已经过去了一段时间,即使她是同一个人,某些他记住的其他特征也可能已经改变了。

  Thus, since none of the caucasian girls have long, dark hair, he ignores these characteristics and searches for someone with the eyes and nose he remembers. He finds two girls with similar eyes, but only one of these has the petite nose he remembers from the original picture. Even though these are less prominent features, he is able to use them to identify the girl.

  因此,既然没有留着黑色长发的白种女孩,他会忽略这些特征,而通过他记住的眼睛和鼻子的特征来查找符合的人选。他找到了两个女孩都有相似的眼睛,但其中只有一个具有小巧的鼻子,这是他从原来的图片中记住的特征。即使没有显著的特征,他也能够识别出这个女孩。

  QuickTest uses a very similar process of elimination with its Smart Identification mechanism to identify an object, even when the recorded description is no longer accurate. Even if the values of your test object properties change, QuickTest's TestGuard technology maintains your test or component's reusability by identifying the object using Smart Identification. For more information on Smart Identification, see Configuring Object Identification.

  即使录制的描述不再准确,QuickTest 也能通过其“智能标识”机制使用非常相似的排除过程来标识对象。即使测试对象属性的值有所改变,QuickTest 的 TestGuard 技术机制也能通过使用“智能标识”标识对象从而维护测试或组件的可重用性。有关“智能标识”的详细信息,请参阅配置对象标识。

  The remainder of this guide assumes familiarity with the concepts presented here, including test objects, run-time objects, object properties, mandatory and assistive properties, and Smart Identification. An understanding of these concepts will enable you to create well-designed, functional tests or components for your application.

  本指南的其余部分假定您熟悉此处出现的概念,包括测试对象、运行时对象、对象属性、强制和辅助属性以及“智能标识”。通过了解这些概念,可以为应用程序创建精心设计的功能测试或组件。

  ——songfun摘自官方 QuickTest Professional User's Guide