Forum Discussion
pradeepbishnoi
15 years agoContributor
Hi Martin,
Here are the code snippets, will do the work you wanted to achieve. Put this code into a grovy teststep and execute it once after updating the values of the property(source & target). Name passed is case sensitive, so please copy the teststep name and paste into the property value.
Will be writing a blog on this topic/issue soon :-) Update the thread if it works for you also.
Best Regards,
~~ Pradeep Bishnoi ~~
http://learnsoapui.wordpress.com
http://pradeepbishnoi.blogspot.com
Here are the code snippets, will do the work you wanted to achieve. Put this code into a grovy teststep and execute it once after updating the values of the property(source & target). Name passed is case sensitive, so please copy the teststep name and paste into the property value.
import com.eviware.soapui.model.testsuite.Assertable
def project = context.testCase.testSuite.project
def testSuite = project.getTestSuiteAt(1)
def testCase = testSuite.getTestCaseAt(0)
def sourceTestStep = context.expand( '${#TestCase#SourceTestStep}' ) // testCase level property "SourceTestStep"
def targetTestStep = context.expand( '${#TestCase#TargetTestStep}' )
def testStepsrc=testCase.getTestStepByName(sourceTestStep)
def testStepTrgt = testCase.getTestStepByName(targetTestStep)
def counter = testStepSrc.getAssertionList().size()
for (count in 0..<counter)
{
testStepTrgt.cloneAssertion(testStepSrc.getAssertionAt(count), testStepSrc.getAssertionAt(count).getName())
}
Will be writing a blog on this topic/issue soon :-) Update the thread if it works for you also.
Best Regards,
~~ Pradeep Bishnoi ~~
http://learnsoapui.wordpress.com
http://pradeepbishnoi.blogspot.com