I am currently using DOM model to identify the objects and perform actions on them. Its the fastest way(As per my current understanding) and I wanted to stick to it. But unfortunately the changing requirements are making me rework on the same things again and again.
Another way I think of is using "Nativeobject.Find" and "Find" method. I consider preferring Find method. But this makes the script execution very slow. Is there any faster way where I can uniquely identify objects on the basis of there properties and at the same time can run scripts at a speed as good as scripts using DOM to identify objects
I'd recommend using Name Mapping in this case (see the "Name Mapping" help topic). You can create aliases for the needed objects to obtain them in a quick and convenient way. Also, in this case, you won't have to modify your entire scripts, you will need to modify just property values in the Name Mapping scheme.
Thanks for suggestion. To be honest I used name mapping much earlier when I started automating using TC but it really isn't a very convincing way. Earlier I was not aware of different tree models in TC so I kept on useing the default hybrid one. Later I discovered DOM feature I really liked it but now even the new requirements demand change in the itemnanes. I guess otherwise DOM is a great way
One question Jared.. IF the source index(that the DOM uses to identify the object) remains same for an object but the location of the object changes then will the code change at my side?
I gues DOM has this advantage over hybrid model that it is independent of the path of the object in the HTML
If object names on your page change, you still can use Name Mapping. You just need to avoid using names to recognize objects. You can recognize them, for example, by the innerText property or another property whose value is stable. Also, you can use several properties that provide unique recognition criteria together.
[ QUOTE ]
IF the source index(that the DOM uses to identify the object) remains same for an object but the location of the object changes then will the code change at my side?
[/ QUOTE ]
Objects in the DOM model are located at the same hierarchy level. So, your code won't depend on their exact location unless they're moved to another frame.