| || |
use statements and/or .opt files: when should they be used?
Does anybody have advice for managing file references?
Up until now I have written use statements in all my files so that each file can be compiled.
And I have neglected to use the optionset for anything except the browser extensions.
I know that this a brute force technique and not elegant.
But it has served me well in the past and has the virtue of being simple.
It also means that the behaviour of my code is not dependent on other Silk Users making the correct version of the correct .opt file active in their Silk Test session before running my tests.
A few weeks ago I raised an issue with the Segue Help Desk concerning integration with Silk Plan.
Among other advice they gave me was a suggestion to use option sets in my 4test code.
I can see that the Use Path and Use File Runtime Options make it possible to remove many of the use statements.
However this mechanism does not work for any files that contain code that extends control classes: I have a few of those that are too useful for me to do without.
So I am stuck with a mixture of use statements and Use File runtime options whether I like it or not.
This has led to my question.
There are 2 mechanisms (that I know of) for implementing references between 4test files:
Runtime Options UsePath and UseFile settings.
use statements in 4test .inc and .t files.
Both have the same essential purpose ,although the behaviour is not identical.
How should I decide which technique to use for a particular file reference?
I know that this might be more of a theological question than a technical question.
However I would appreciate any advice from anybody with strong opinions ,particularly if they are based on lessons learned the hard way.
I did search the Silk Test forum on "use .opt" but I did not find anything that addressed this issue.
Apologies if I missed any earlier posts and this has been dealt with before.
Thanks in advance.
Re: use statements and/or .opt files: when should they be used?
As I suspected ,this question has been addressed in the past.
Just needed to try searching on "optionset".
There seems to be a wide variety of opinion.
However ,optionsets do seem to be more flexible than use statements, offering the ability to change the code behaviour without the need to Edit any files.
Now all I have to do is make sure that everything still works when integrated with Silk Plan.