Forum Discussion
Below are the Script I have used, It is executing but not updating the endpoints.
def stage1 = testRunner.testCase.testSuite.getPropertyValue( "STAGE1" );
def testcases = testRunner.getTestCase()
//Environment Selection Staging 1
testcases.each {
testcase ->
def teststeps = testcase.getTestStepList()
teststeps.each { teststep ->
teststep.setPropertyValue('Endpoint',stage1)
}
}
def testing = testRunner.testCase.testSuite.project.getTestSuiteByName("Logging Availability_STAGE").getTestCaseByName("INFO_ESBLOGS_STAGE").getTestStepByName("Staging1")
testing.run(testRunner, context)
In my view, the better way would be to create a library to achieve so. Have a class and methods and call them in groovy script in order to achieve re-usability.
Please see below link to see how to do it:
http://rupertanderson.com/blog/1-how-to-develop-add-and-use-a-custom-groovy-library-in-soapui/
Otherway, there is no need to call a groovy script in another script as you can have the same script here it self. If you want to achive re-usability, then above is the right way. And you do not have to create the other groovy script step itself.
Related Content
- 2 years ago
- 4 years ago
Recent Discussions
- 4 days ago