Forum Discussion

jayakotib4u's avatar
jayakotib4u
Occasional Contributor
10 years ago
Solved

How to add reference of other units from one project suite into another suite?

Hi, i have some generic methods in different units in Test complete as shown below:

TestProject1(pjs)

Unit1:

Function fun1_1()
'do something
End Function

Function fun1_2()
'do something
End Function

Unit2:
'UserUnit Unit1
Function fun2_1()
'do something
End Function

Function fun2_2()
'do something
End Function

Unit3:
'UserUnit Unit1
Function fun3_1()
'do something
End Function

Function fun3_2()
'do something
End Function

WrapperUnit:
'UserUnit Unit1
'UserUnit Unit2
'UserUnit Unit3
Function WrapperFun1_1()
   Call fun1_1()
End Function
Function WrapperFun1_2()
   Call fun1_2()
End Function
Function WrapperFun2_1()
   Call fun2_1()
End Function
Function WrapperFun2_2()
   Call fun2_2()
End Function
Function WrapperFun3_1()
   Call fun3_1()
End Function
Function WrapperFun3_2()
   Call fun3_2()
End Function

Now i could just use only WrapperUnit(where all units references added) to access methods of all units.
But in other Project(pjs) file, if i want to access the methods in above units by only using WrapperUnit, how could i do it? please suggest me. When i include only WrapperUnit in new project suite file, it is also asking for other units to be reference.

Regards,
Jayakoti

9 Replies

  • william_roe's avatar
    william_roe
    Super Contributor

    Add usenet statment on first line of script unit. The following allows access to code in Purchasing.sj. Please mark as solution if this solves your problem.

     

    //USEUNIT Purchasing

    • jayakotib4u's avatar
      jayakotib4u
      Occasional Contributor

      Hi William i didn't get what exactly you are saying. i have already tried below one, but it didnot work:

       

      In TestProject2(pjs file), -> under script Unit1:

      'UseUnit WrapperFunction

       

      In this case it is still asking for adding scripts (Unit1,23) using Add -> existing item. Idea here is to avoid adding the scripts(unit1, Unit2 and Unit3 from TestProject1 again in current project - TestProject2).

       

      Hope you got it.

       

      please refer the attachment for more details.

       

      Regards,

      Jayakoti