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)
I'm not sure how you can run individual test steps, but can I suggest that if you want to create reusable functionality you create you create it as TestCases, this way you can use the provided Run TestCase Test Step functionality. I go into a lot more detail of creating reusable functionality in the following two posts;
https://community.smartbear.com/t5/SoapUI-Pro/How-to-loop-Test-Suites-or-Test-Cases/m-p/144035
Alternatively you if it is just Groovy code you want to run from multiple locations, you can move this into a Groovy script library, see the following documentation page:
https://support.smartbear.com/readyapi/docs/testing/scripts/library.html
Related Content
- 2 years ago
- 4 years ago
Recent Discussions
- 4 days ago