sbkeenan
13 years agoFrequent Contributor
Adding and Removing References
Hi
When working on a new test case, I usually create a Globals project within the project suite that I use to hold a name mapping unit and one or more class files. My other projects contain their own name mapping units that I merge with the one held in Globals and I use the USEUNIT line at the top of any scripts that I need to reference the class files and also add the class files to the project(s) in question by right-clicking on the Script unit and using the Add Existing Item option.
All of the above works well and I have no problems with its use, however, the particular test case I am working on will require access to many different class files, both from within the existing project suite and from within other project suites. Again, I have no problems with making this all work, but I do have one problem. If I create a reference to a class file that subsequently is not required, how do I remove it? If I right-click on it and select Remove then Delete, TestComplete will actually delete the original file from its original location, meaning that every other reference in every other script file that references it will be broken. Could it be a suggestion that this kind of removal/deletion on a reference item simply removes the reference link, leaving the original file intact? I guess that simply selecting Remove from the right-click menu is the answer to this question at present, but if the Delete option is accidentally selected, it's pretty catistrophic if there is no backup available!!
I've also looked at the Add Unit References option, but this only seems to work if there is more than one reference, i.e. if a script references more than one other unit, I can remove the ticks against the ones I don't require and click on OK, however, in my case the other units are themselves references to other class files and I don't want to have any of their code modified. If I remove all the ticks, I cannot click on OK. Is there something that I am overlooking?
Finally, could I make a suggestion that the referenced items in the project tree have a different icon, something to show that they are references to other units, perhaps something like the Windows shortcut icon, where a little arrow appears in the bottom left corner. This would make it visually clear that a particular item is a reference to an original in another location.
Many thanks.
Regards
Stephen.
When working on a new test case, I usually create a Globals project within the project suite that I use to hold a name mapping unit and one or more class files. My other projects contain their own name mapping units that I merge with the one held in Globals and I use the USEUNIT line at the top of any scripts that I need to reference the class files and also add the class files to the project(s) in question by right-clicking on the Script unit and using the Add Existing Item option.
All of the above works well and I have no problems with its use, however, the particular test case I am working on will require access to many different class files, both from within the existing project suite and from within other project suites. Again, I have no problems with making this all work, but I do have one problem. If I create a reference to a class file that subsequently is not required, how do I remove it? If I right-click on it and select Remove then Delete, TestComplete will actually delete the original file from its original location, meaning that every other reference in every other script file that references it will be broken. Could it be a suggestion that this kind of removal/deletion on a reference item simply removes the reference link, leaving the original file intact? I guess that simply selecting Remove from the right-click menu is the answer to this question at present, but if the Delete option is accidentally selected, it's pretty catistrophic if there is no backup available!!
I've also looked at the Add Unit References option, but this only seems to work if there is more than one reference, i.e. if a script references more than one other unit, I can remove the ticks against the ones I don't require and click on OK, however, in my case the other units are themselves references to other class files and I don't want to have any of their code modified. If I remove all the ticks, I cannot click on OK. Is there something that I am overlooking?
Finally, could I make a suggestion that the referenced items in the project tree have a different icon, something to show that they are references to other units, perhaps something like the Windows shortcut icon, where a little arrow appears in the bottom left corner. This would make it visually clear that a particular item is a reference to an original in another location.
Many thanks.
Regards
Stephen.