简体   繁体   中英

different indexes for same WebTable in UFT?

I'm trying to recognize a WebTable in UFT using descriptive programming . I've tried many ways, but it's not working. Finally, it worked with index like for example WebTable("index:=1")

But the thing is when I try the test case from different PCs , the web table is not recognized and I need to change the index like from 1 to 2.

My question is: Why does the index change?

An ordinal identifier assigns a numerical value to a test object that indicates its order or location relative to other objects with an otherwise identical description (objects that have the same values for all properties) This ordered value provides a backup mechanism that enables QuickTest to create a unique description to recognize an object when the defined properties are not sufficient to do so. Index is quite similar to location, but it works pertaining to appearance of objects in the source code. An object appearing prior in the source code will have a smaller Index value as compared to another object that comes later in the source.

Loading is not a concept here the concept is object mapping on the prior of code as you used programmatic description & everything was same except PC's.I think you know there is a specific optimization in QTP which you seem to have run into. In addition to the regular description QTP stores the sourceIndex as a hidden property. Then when trying to identify the object it will first check if the object with the stored sourceIndex matches the description, if it does it assumes that it's the correct object and doesn't search the whole DOM. Since the ordinal(index in this case) is a special property that is used for identification only if multiple objects match, the sourceIndex optimization circumvents usage of the index.there may be one more possibility that QTP also stores a generated XPath to the object which has similar functionality. It may possible that in other machine automatic XPath identifier may be disable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM