0

I know that in soapUI test request and in the assertion panel, it's possible to create a script assertion with a groovy script.

What I need is to create a script assertion with a script, but not through the test request, but by a separate groovy script itself. Is it possible to create a script assertion for a soapUI request with the help of Groovy Script itself?

1 Answer 1

1

I have found out the answer and here it is.

def stepname = testRunner.testCase.testSuite.getPropertyValue("TestRequestStepName")
def assertion = testRunner.getTestCase().getTestStepByName(stepname).addAssertion("Script Assertion")
assertion.setScriptText("hai from assertion.setScriptText.....")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.