Forum Discussion

mgupta1405's avatar
mgupta1405
Occasional Contributor
13 years ago

Assertion using Groovy

I was trying to add assertion using Groovy script using the following code

import com.eviware.soapui.model.testsuite.Assertable

def project = context.testCase.testSuite.project
def testSuite = project.getTestSuiteAt(0)
def testCase = testSuite.getTestCaseAt(0)

wsdlTestSteps = testCase.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.class)

def testStepCount = wsdlTestSteps.size()
( 0..< testStepCount).each
{
// SOAP Response Not SOAP Fault
if (!(wsdlTestSteps[it].getAssertionByName(“Not SOAP Fault”)))
{
wsdlTestSteps[it].addAssertion(“Not SOAP Fault”)
}
if (!(wsdlTestSteps[it].getAssertionByName(“SOAP Response”)))
{
wsdlTestSteps[it].addAssertion(“SOAP Response”)
}
}


I got the following stacktrace while executing the script

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script10.groovy: 13: unexpected token: SOAP @ line 13, column 57. s[it].getAssertionByName(“Not SOAP Fault ^ org.codehaus.groovy.syntax.SyntaxException: unexpected token: SOAP @ line 13, column 57.


What is the error in this and the possible solution?

Thanks
Mohit
No RepliesBe the first to reply