Forum Discussion

jkrier's avatar
jkrier
Regular Contributor
8 years ago

Iterate over all available environments

I would like to loop through all of my available environments. We use a load balancer in front of 2 jvm nodes. It would be ideal to be able to run against all 3 end points during a test run. I have a...
  • Radford's avatar
    8 years ago

    The environment classes are part of the "Pro" functionality, and doesn't show up in the code completion options (I've logged this with SmartBear and it's now enhancement request API-957).

     

    You get the environment details from the WsdlProjectPro object, see sample code below:

     

    // Get the current active environment
    log.info(testRunner.getTestCase().getTestSuite().getProject().getActiveEnvironmentName()) 
    
    // Loop through each of the environments
    testRunner.getTestCase().getTestSuite().getProject().getEnvironmentList().each{ environment -> 
    	log.info(environment.getName())
    }