Forum Discussion

ramefi's avatar
ramefi
Occasional Contributor
8 years ago

Regarding the feature:calling routines from another project.

Hi  , we are  calling the routines from a project where we have used ui plugin to write code to another project wheich is not being used Ui plugin to write code. 

 

I followed the same procedure which is suggested by you in the page https://support.smartbear.com/testcomplete/docs/scripting/calling-routines/declared-in-another-project.html

(Like create an existing item etc ) however all routines got failed . Found out that they are getting failed because of Ui plugin is not enabled in the current project. Let us know the workaround except enabling the Ui plugin. 

 

 

8 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

     There are only a few limited ways of calling code across projects.  Adding units as existing items, plugins, and script extensions.  Consider a project as a "compiled" application.  Everything that project needs to be able to be run needs to either be contained within or able to be referenced by that project.  So, if your UI plugin is necessary to run your tests, you need to include it...or, find some other method of getting the same functionality the plugin provides to your other project.

    • ramefi's avatar
      ramefi
      Occasional Contributor

      Hi ,

             if you look at the applications now especially on the larger projects/products  all are built with one or more technologies.we went through the support documents   and concluded  that we could call routines from one project to another. so we have used ui plugin for one technology with in the product. and for other without ui plugin . Now  the integration of both has come up and we have to automate that. because of the above limitation we couldn't complete the project.

       

      SmartBearDan could any of the smart bear staff give us the workaround or any other way to call routines from different projects  which uses different properties . this  would help us to save the time. 

       

      if no,t i strongly suggest,  you should change your document by adding this limitation  as most of the automation engineers will decide the project strategy by looking at your support documents.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        I am sure SmartBear folks will come back with an official response.  But the article you linked in your OP specifically talks about including units from one project to another by adding them as existing items, essentially making them common libraries of code.  Nothing is mentioned in that article about what happens if those units are dependent upon a particular UI plugin.  Basically, to use something across multiple projects, you need to include it in multiple projects. So, if you have an item that has a dependent on a particular plugin and you are including that item in another project, that other project is now also dependent on that plug in.  To make it even simpler... in Project1 if I have Unit1, Unit2, and Unit3 and Unit3 calls functions from Unit1 and Unit2, if I add Unit3 to Project 2, I also need to add Unit1 and Unit2 as well otherwise Unit3 will fail.  This is not a matter of plugins, it's a matter of context. Such is the case, really, in any technology.  

         

        For example, in Netbeans when I'm developing java applications, if in one application I create a class that is dependent upon having a particular jar included in the project, if I take that class to a different project, I must also include that jar in that project. I can't just expect the class to work in the new project if I don't bring over it's dependencies as well.

        That's basically the scenario you created.  Your tests and code and such in your first project are dependent upon a particular plug in.... to use them in a different project, you need to bring that plug-in along for the ride.  I don't know exactly what the plug in is, who created it, etc... but if you have code dependent upon it, that code will not work if the plug-in is not present.