Forum Discussion
- AlexKarasChampion Level 3Hi,
Add a unit from another project as existing one to the current project (i.e. this unit will be shared between those two projects and changes made in one project will be reflected in the other one) and reference it from the callee unit using the useunit or uses statement depending on the script language used in those test projects. - IRISQATeamContributor
Thanks for your reply. When adding an existing item works fine when there is no involvement of NameMapping.
Project A: Unit 1, has its own NameMapping
Project B: Unit 2, has its own NameMapping,
When I am do Add -- Existing Item Unit 1 in Project B, it copies the Unit 1 file into Project B but I can’t run this file as it doesn’t have NameMapping of Project A.
Is there any other workaround where I can just reference into Project B and just access the Project A units/methods? - AlexKarasChampion Level 3Hi,
> Is there any other workaround [...]
No, it is not possible to reference a script unit from another project so that this referenced unit used NameMapping from its original project.
Three options are possible in your case:
a) Merge NameMapping from those two projects and continue with maintaining one common NameMapping;
b) Create a copy of the unit in another project and continue with maintaining two copies of code;
c) Do not use NameMapping in the scrit unit shared between several projects but use coded approach (Find, FindChild, EvaluateXPath, ...) to search for and operate with the tested objects.
Related Content
- 2 years ago
Recent Discussions
- 10 hours ago
- 7 days ago
- 10 days ago