how to clone single test step to multiple testcases in Ready API version 2.8
I have a test Step that needs to copied to all testcases in a suite. Clone TestStep allows me to copy to only 1 another testcase.
in this process, I have to clone teststep one by one to all testcases. this is time consuming as there are around 20- 30 testcases in a suite.
In documentation, I saw there is a way but I am not seeing that option in version 2.8.
You can do it with groovy i believe.
I can probably put the groovy together to update 1 test at a time - which wont really save you anytime (over using the embedded functionality) cos my groovy skills bite.
Perhaps @ChrisAdams or @nmrao can save the day?
On a related note, you state that more recent versions of ReadyAPI provides functionality to clone steps to multiple testcases. I didnt realise that. Ive looked in the help and i could find that in there. Could you post a link to where you saw this please? I had a quick look in help and played with the clone stel functionality, but i couldnt see how to do it on later versions.
you can automate this by a Groovy script:
project = context.getTestCase().getTestSuite().getProject()
step = project.getTestSuiteByName("MySuite").getTestCaseByName("MyCase").getTestStepByName("ToBeCloned")
testSuite = it
testCase = it
How it works:
- First get a test step you want to clone (ToBeCloned)
- Go through all test suites
- Loop through all test cases within the suite
- Clone a selected test step into current test case (you can set a new name)
I recommend to do a backup of your SoapUI project.
Then you can place this script into a Groovy script test step, modify the names a run it.