lagap
17 years agoNew Contributor
Adding Script assertions dinamically
I am a newbie to SoapUI, I am using soapui-pro-2.0.2.
I am trying to add script assertions dynamically through a groovy script.
Below is the code being used.
def assertion = testRunner.getTestCase().getTestStepByName("Request").addAssertion("Script Assertion")
assertion.name = "ScriptAssert1"
assertion.a(assertion,”assert(1==2)”)
Assertion is being shown as passed (1==2) after request execution.
However, if I open the assertion from the GUI and touch it (Add a space), it shows the right result (Which is fail).
Can you please point me, if I am adding the script assertion in wrong way?
Thankyou
I am trying to add script assertions dynamically through a groovy script.
Below is the code being used.
def assertion = testRunner.getTestCase().getTestStepByName("Request").addAssertion("Script Assertion")
assertion.name = "ScriptAssert1"
assertion.a(assertion,”assert(1==2)”)
Assertion is being shown as passed (1==2) after request execution.
However, if I open the assertion from the GUI and touch it (Add a space), it shows the right result (Which is fail).
Can you please point me, if I am adding the script assertion in wrong way?
Thankyou