Groovy: loop and run all teststeps using testcase properties
Hi all,
This is my first post on the smartbear community forum. I searched for a post something similar to my problem, but I couldn't find it.
I am using SoapUI for many years now. We are building soap/xml integrations and use SoapUI for our Unit Tests. It started simple, but we are trying to make our project more and more reliable and stable using groovy scripts.
My test-projects often contains disabled DB-query and property transfer teststeps. These teststeps are only needed when the back-end gets a new clone and testdata needs to be refreshed. By disabling these (often very slow) query teststeps, our unit test projects run much faster.
I am trying to make a groovy script which can be executed to refresh the whole project in one run. This means that the groovy script needs to execute all teststeps, including the disabled teststeps. I already made the following script, which executes all teststeps in one testsuite (inlcuding the disabled ones).
def testsuite = testRunner.testCase.testSuite
def currentTestCase = testRunner.testCase.name;
for(testcase in testsuite.testCaseList) {
if (testcase.name != currentTestCase) {
for (step in testcase.testStepList) {
step.run(testRunner, context)
}
}
}
However, some (disabled) teststeps use testcase properties (e.g. ${#TestCase#propertyName} ). When running the teststeps using the script above, these properties are not resolved and the teststep failes.
Does anyone know how to make the testcase properties available to the teststeps?
Thanks!
Jan