Configure ReadyAPI new environment using Groovy
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Configure ReadyAPI new environment using Groovy
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.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@UhsBat :
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>");
testRunner.testCase.testSuite.project.setActiveEnvironment(env)
Hope it will help you 🙂
Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓
Thanks and Regards,
Himanshu Tayal
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply.
Using setActiveEnvironment I can only set the existing environment. But I want to create a new environment in ReadyAPI using groovy scripts.
Ex:
suppose I have two envs DEV1 and SIT1, now I want to clone DEV1 and rename it as UAT1 or create a new env UAT1.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are different ways of doing it.
Here another way to accomplish the same (without even using the environment feature)
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Community Heroes🙂
@UhsBat Have you tried the latest advice from this thread? How did it go?
Sonya Mihaljova
Community and Education Specialist
