| || |
Object content = object caption
The problem I am experiencing is that when I do a window declaration or record a testcase, for some HTML objects SilkTest 6.0 takes the contents of the object at the time of capture as the objectís caption. For example, if a surname field has SMITH in it when the window declaration is recorded, the caption for the object is SMITH. If an object has nothing in it when the window declaration is recorded, no declaration for that object is recorded.
I have experimented with options for identifiers and tags to try and get meaningful names for the objects without using the caption. For the tag I have used Index, which seems to work all right. For the identifier, however, I cannot use the Window ID because it changes. Using the 4Test class creates a window declaration that a tester cannot understand or maintain, because there might be, say, 15 instances of HTMLText on a screen and no way to distinguish them easily.
If I use the caption for the identifier in the window declaration and then change it, when I record a testcase the recorder identifies that object by whatever is in the object at the time (JONES) and does not associate the object with the window declaration.
Can you suggest a way around this?
Re: Object content = object caption
First off, I would suggest that you ignor the contents that might appear in of each object as temporarily irrelevant and instead capture what you know about them. For example Smith and Jones would appear in a "Name" object. So create a 'Name' object declaration. Do this also for every other field that might appear. Presumably these might be Street Address, City, State Phone Number, etc. If a statictext label is always paired with each HTMLText, use that to identify them - apply whatever a user of this app' would use to recognize what the object is and how they might interpret it.
The appearance of these fields is controlled by some logical algorithm. Maybe the other "15 instances of HTMLText" only appear after a Name is entered. Logically then you wouldn't attempt to use these fields until after a name is entered.
Statictext is the preferred method for creating tags. #-indexed tags are probably next, but they are positionally sensitive - a #1 tag will only be true if no object of its class appears above it (which would then make it the second instance of "#2").
For each possible scenario you need to consider the interrelationship of the tags and find a combination that will remain stable and trustworthy.