Forum Discussion

paulp123's avatar
paulp123
New Contributor
14 years ago

How to change an assertion expected result by code ?

Hi all,
I'm very very new to Soap UI and Groovy.
I need to change for a assertion testStep the expected result value. Is this possible.

def testStep = testRunner.testCase.getTestStepByName("ValidationRequest")


testStep.getAssertionByName("ValidateResponse")
do not have a method to change the expected result value.

http://www.soapui.org/apidocs/com/eviwa ... rtion.html

Is it possible to change the assertion expected result by code?
  • paulp123's avatar
    paulp123
    New Contributor
    A coleg found the solution.
    Here it is:

    def test1 = testStep.getAssertionByName("ValidateResponse")
    test1.expectedContent = "expected result value..."


    Thanks,
    Paul