???????About Understanding the Test Object Model

????????????????????

????QuickTest tests your dynamically changing application by learning and identifying test objects and their expected properties and values. During recording QuickTest analyzes each object in your application much the same way that a person would look at a photograph and remember its details.

????QuickTest ??????????????????????????????????????????????ó?????в????????????QuickTest ????ó??????????????з??????????????????????????????????????????

????In the following narrative you will be introduced to the concepts related to the test object model and how QuickTest uses the information it gathers to test your application.

???????????????У????????????????????????????? QuickTest ??????????????????????????ó???

????1??Understanding How QuickTest Learns Objects While Recording

??????? QuickTest ????????????????

????QuickTest learns objects just as you would.

????QuickTest ???????????????

????For example?? suppose as part of an experiment?? Jonny is told that he will be shown a photograph of a picnic scene for a few seconds during which someone will point out one item in the picture. Jonny is told that he will be expected to identify that item again in identical or similar pictures one week from today.

???????磬????????????????Jonny ??????????????????????????????????????????????????????????е?????????????????Jonny ?????????????????????????????????

????Before he is shown the photograph?? Jonny begins preparing himself for the test by thinking about which characteristics he wants to learn about the item that the tester indicates. Obviously?? he will automatically note whether it is a person?? inanimate object?? animal?? or plant. Then?? if it is a person?? he will try to commit to memory the gender?? skin color?? and age. If it is an animal?? he will try to remember the type of animal?? its color?? and so forth.

???????????????Jonny ???????????????????????????????????????????????????????Щ????????????????????????????????????????塢????????????????????????????????????????????????????????????????????????

????The tester shows the scene to Jonny and points out one of three children sitting on a picnic blanket. Jonny notes that it is a caucasian girl about 8 years old. In looking at the rest of the picture?? however?? he realizes that one of the other children in the picture could also fit that description. In addition to learning his planned list of characteristics?? he also notes that the girl he is supposed to identify has long?? brown hair.

???????????? Jonny ????????????????????????????????????????Jonny ?????????? 8 ???????????????????????е??????????????????????е?????????????????????????????????????????б?????Jonny ?????????????????????????????????????

????Now that only one person in the picture fits the characteristics he learned?? he is fairly sure that he will be able to identify the girl again?? even if the scene the tester shows him next week is slightly different.

???????????????????????????????????????????????????????????????в??????????????????????????????

????Since he still has a few moments left to look at the picture?? he attempts to notice other?? more subtle differences between the child he is supposed to remember and the others in the picture—just in case.

????????????????????????????????????????Jonny ????????????ü???????????????????????????????????

????If the two similar children in the picture appeared to be identical twins?? Jonny might also take note of some less permanent feature of the child?? such as the child's position on the picnic blanket. That would enable him to identify the child if he were shown another picture in which the children were sitting on the blanket in the same order.

????????????????????????????????????????? Jonny ????????????????Щ???????????????????????????????λ?á??????????????????????????У???Щ???????????????????????????????????????????

????QuickTest uses a very similar method when it learns objects during the recording process.

????QuickTest ??????????????????????????????м??????

????First?? it "looks" at the object on which you are recording and stores it as a test object?? determining in which test object class it fits. Just as Jonny immediately checked whether the item was a person?? animal?? plant?? or thing. QuickTest might classify the test object as a standard Windows dialog box (Dialog)?? a Web button (WebButton)?? or a Visual Basic scroll bar object (VbScrollBar)?? for example.

?????????????“???”???????????????????????????д洢?????????????????????????? Jonny ???????????????????????????????QuickTest ????????????з??????磬??? Windows ????? (Dialog)??Web ??? (WebButton) ?? Visual Basic ?????????? (VbScrollBar)??

????Then?? for each test object class?? QuickTest has a list of mandatory properties that it always learns; similar to the list of characteristics that Jonny planned to learn before seeing the picture. When you record on an object?? QuickTest always learns these default property values?? and then "looks" at the rest of the objects on the page?? dialog box?? or other parent object to check whether this description is enough to uniquely identify the object. If it is not?? QuickTest adds assistive properties?? one by one?? to the description?? until it has compiled a unique description; like when Jonny added the hair length and color characteristics to his list. If no assistive properties are available?? or if those available are not sufficient to create a unique description?? QuickTest adds a special ordinal identifier?? such as the object's location on the page or in the source code?? to create a unique description?? just as Jonny would have remembered the child's position on the picnic blanket if two of the children in the picture had been identical twins.

???????????????????????QuickTest ?????????????????????????б???????? Jonny ?????????????????????????б???????????????QuickTest ???????Щ??????????????“???”???????????????????????????????????????????????????????????????б????QuickTest??????????????????????????????????????????????????? Jonny ???????б????????????????????????????????п??????????????????Щ????????????????????????????????QuickTest ??????????????????????????????????????ж????λ???????????????????????е?????????????????????Jonny ?????????????????λ???????