Forum Discussion
- maddenapallyContributor
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)- RadfordSuper Contributor
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
- nmraoChampion Level 3
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.
- TanyaYatskovskaSmartBear Alumni (Retired)
maddenapally, did you find the solution you want to use?
- maddenapallyContributor
Yes, Thanks
Regards,
Karthik
- TanyaYatskovskaSmartBear Alumni (Retired)
That's great to hear. Do you mind sharing it with us? This may help other users who will face a similar question.
Related Content
- 2 years ago
- 4 years ago
Recent Discussions
- 5 days ago