Couple of simple question from Silk newbie -
1. My window decl has so many objects that I may never use. Is it better to record window declaration and only save useful objects. ie. open the .inc file and delete the objects that will never be used.
2. Do people use functions to get a list of specific objects and use that to generate window declarations .inc file? (I would not have to do this if the Window declarations capture window would let you filter or sort by object type.)
[This message has been edited by softlogger (edited 10-08-2002).]
There really is no substitute for an excellent include file. I find that I spend quite a bit more time getting good declarations than I do actually coding the tests. You'll be thankful for it later.
Now, one trick is to make effective use of the collapsable code. Place a comment in the include file that tells what is under it, then nest your declarations one "bump" to the right of that comment and collapse it. That will clean things up a bit visually, while preserving the declarations for you to use in the future.
Being new to the application, it might make sense to pare down the list. You will be better able to find and focus exactly what you need then.
Also, the declaration might not even structured in a beneficial way - especially if you have a complex window.
Once you get familiar with the application and the declarations you need, added them back in as you need them is easy. And you will likely create these from scratch anyway - as opposed to just taking what SilkTest decides.
I've done it both ways but I am slowly changing to deleting declarations that I'm not immediately going to use. This keeps down the clutter, and provides a way to know for certain that objects that appear in the declarations ARE being utilized by something somewhere.
As a matter of course I always delete the statictext objects that are directly associated with input controls. The input control uses the static text as its tag, so I lose nothing by doing this.
I have never deleted any of the currently unwanted objects from the declaration, except for the static text items ofcourse. The reason being that the app that we were testing was under continuous developement, actually came out with 10 major releases and for every test cycle the coverage kept on increasing. So we actually had no idea whether the items now in the declaration could or could not be used in the future.
I dont have to highlight here that we built re-usable scripts right from day one