We are executing ReadyAPI soap testcases in many environments, and now we need to create automation suite for different functionality in all those environments. Problem is to define all environments and lots of endpoints every time we create new projects.
Is there any way to configure new environments using Groovy scripts so that I can use 'Scripts library' feature to load all the environments when ever I create a new project in ReadyAPI.
You can try below commands to get the Active Environment name and and set new environment by name:
//To get the active Environment:
def env = testRunner.testCase.testSuite.project.getActiveEnvironment().getName()
log.info("Active Environment: " + env)
//To change the active Environment:
def env = testRunner.testCase.testSuite.project.getEnvironmentByName("<ENV NAME>");
Hope it will help you 🙂
Click "Accept as Solution" if my answer has helped, and remember to give "kudos"🙂 ↓↓↓↓↓