Forum Discussion
Well, there are several considerations going on here. As you noted, importing a test into another project creates a reference to the original. This is actually by design and actually fairly common usage. In fact, what we do here is, any tests that are "common" between projects we store in a completely separate folder in our source control called "Common\KeywordTests" and "Common\Scripts".
As for the namemapping, yes, you'll need to find some way of making the name mapping universal as well. You can use the built in "Merge with" for name mapping. I've had some success with that but, if you're name mapping tactics are "lazy", you could end up with a lot of duplicated objects. What I've found works best is, just like was done with the keyword tests and scripts, create a "Common\NameMapping" folder and put a single NameMapping file in that folder that all my projects reference. You won't need to "merge" anything in TestComplete (although, you'll need to do some merging on occasion in whatever source control you use).
As for local or project level variables. If the variable is part of the Keyword test or is declared locally in the script code unit, there's no need to "merge" that. It is brought along with the file as a "common" piece. Project level variables are a different story. Since you are in a project suite and you want to continue to use the variable provided like they are on projects, there are Project Suite level variables. Consider moving your "global" variables from the project level to the suite level.
As for a tutorial - everyone's "needs" are different. There are different tactics for different needs. I don't think there is a specific "tutorial" on "Here's all the stuff you need to do when sharing a keyword test between projects". Good idea, though, but, no, doesn't exist. Basically, though, the rule of thumb is that if your test is using something that is in one project, you need to find some means of making it available to all the projects in which you are using the test.
Hopefully what I've mentioned above helps you sort stuff out.
Thanks for you reply!
Here is what I did : imported a test from another project and merged the name mapping too. There were some conflicts in the merge and I have the _new items in the mapped and aliases.
1)When I run the imported test, it cannot find the objects.
2) If I point these objects to the newly merged objects (_new) - as the changes are saved to this test, it will not run when I run it from the original project.
How do I fix the name mapping so that the test can be run from both the projects?
- tristaanogre8 years agoEsteemed Contributor
What you need to do is resolve the conflicts in the merges... get everything down to 1 set of objects with a consistent naming so that, no matter what project you're in, it will work. That's pretty much where your work load is right now since you're not using a shared name mapping file.
Related Content
Recent Discussions
- 13 hours agotramuntana
- 3 days agoSlickRick