Ask a Question

How can i access other projects script routine

SOLVED
Kamal_chennai
Contributor

How can i access other projects script routine

Hi,

i have a two projects like "Test1", "Test2". the script routine was created in "Test2". i may access the Test2's script routine via "Add Existing Item"(i.e.,Reference.png ) i dnt want that method. now i want to call Test2's script routine function in Test1 Keyword. is it possible???



1 ACCEPTED SOLUTION

Accepted Solutions
altus_nel
Contributor

RE: How can i access other projects script routine

Hi Kamal,



Did you manage to access the links provided? In any event... So.... you have (in your example) 2 projects. Let's say you created In project 2 (in your case Test 2) a script routine that you now want to "call" in Test 1. As per [http://support.smartbear.com/viewarticle/56535/] this is not technically possible. You have some options available to get past this:


  • Add a script unit that contains the routines defined in the other project (you will have to copy and paste (the problem i have with this is maintenance).


  • You can create a "library"  unit and add them to your projects as needed.


Another option (that i prefer) is to write an extension for TestComplete. If you have routines (functions) that you use accross different projects, it would make sense to store these functions in 1 location. Have a read through this resource.



The simplest way for you to achieve your goal is the simply copy and paste the routine (function) to the other unit in the other project.



Hope this clears it up somewhat ๐Ÿ™‚



Altus

View solution in original post

5 REPLIES 5
altus_nel
Contributor

RE: How can i access other projects script routine

Hi there,



This is what you are looking for and you should have a look at this as well.



Hope this helps!

Altus
Kamal_chennai
Contributor

RE: How can i access other projects script routine

Hi atlus sorry,

Can you make me clear, i didn't get your point ๐Ÿ˜ž
altus_nel
Contributor

RE: How can i access other projects script routine

Hi Kamal,



Did you manage to access the links provided? In any event... So.... you have (in your example) 2 projects. Let's say you created In project 2 (in your case Test 2) a script routine that you now want to "call" in Test 1. As per [http://support.smartbear.com/viewarticle/56535/] this is not technically possible. You have some options available to get past this:


  • Add a script unit that contains the routines defined in the other project (you will have to copy and paste (the problem i have with this is maintenance).


  • You can create a "library"  unit and add them to your projects as needed.


Another option (that i prefer) is to write an extension for TestComplete. If you have routines (functions) that you use accross different projects, it would make sense to store these functions in 1 location. Have a read through this resource.



The simplest way for you to achieve your goal is the simply copy and paste the routine (function) to the other unit in the other project.



Hope this clears it up somewhat ๐Ÿ™‚



Altus

View solution in original post

Ravik
Super Contributor

RE: How can i access other projects script routine

Yes, itโ€™s possible. If you have several test projects, you may want to use the same routines from one project in other ones. The uses (or USEUNIT) clause added to a unit, lets you refer to routines defined in other units of the same project.



If you need to call routines defined in a unit from another project, you should add a unit that holds these routines to your project. To do this, right-click the Script project item in the Project Explorer panel and choose Add | Existing Item from the context menu. This will display the standard Open File dialog where you can specify the unit to be added.   


If the unit includes routines that you do not want to โ€œexportโ€, you can create a new unit by selecting New Unit on the Units toolbar, copy the needed routines to this unit and then add the new unit to the desired project. You can even create a unit โ€œlibraryโ€, that is, units that hold the desired routines, and then add these units to any project you want.


Kamal_chennai
Contributor

RE: How can i access other projects script routine

Thnks Guys,

Let me try it out
cancel
Showing results forย 
Search instead forย 
Did you mean:ย