Forum Discussion

archana1's avatar
Occasional Contributor
4 years ago

Active enviroment of other project in current project using groovy

HI Team,

I am trying to access active environment of a project into my current project but it always return me default environment even though environment is not default.

Code is below:

project = new WsdlProject(projectPath+"/SharedService-readyapi-project.xml"); project.getActiveEnvironment().getName()


4 Replies

    • groovyguy's avatar
      Champion Level 1

      My example requires the other project to be loaded and open in the current workspace, but it has worked for me. Is that sufficient, or do you need to know this from a project that is not imported and open?


      def workspace = context.testCase.testSuite.project.workspace.
      def otherProject = workspace.projects["ProjectName"];
      def otherName = otherProject.getActiveEnvironment().getName();


      • archana1's avatar
        Occasional Contributor

        Workspace is not working when working from command line. How else can i do it?