evenflow58
8 years agoNew Contributor
Get environment url in groovy script
Is there a way to get the url set for an environment in a groovy script?
- 8 years ago
To get the URL, you can use the following snippet. It's not pretty, but it works.
def env = testRunner.testCase.testSuite.project.activeEnvironment; log.info(env); def proj = env.getSoapServiceCount().toInteger(); for (int i = 0; i < proj; i++) { def soap = env.getSoapServiceAt(i); def config = soap.getEndpoint().config; def endpoint = new XmlSlurper().parseText(config.toString()); log.info(endpoint); }