mgupta1405
13 years agoOccasional Contributor
Assertion using Groovy
I was trying to add assertion using Groovy script using the following code
I got the following stacktrace while executing the script
What is the error in this and the possible solution?
Thanks
Mohit
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