error "unexpected end of file after null " into assertion script in Ready API 2.1
Hi I am getting this error "unexpected end of file after null " into assertion script .
My script is correct, however I still getting this error ,so I am wondering what is the root cause of this error ?
Here is my script
mport com.eviware.soapui.support.XmlHolder
def log = this.log
// retrieve the field from response
def response = context.expand('${#getBank Request#response}')
def holder = new XmlHolder(response)
// expected Bankmane for input file
def expectedBankName = context.expand('${StartLoop#ExpectedBankName}')
// actual bank name from response
def actualBankName = holder.getNodeValue("//ns1:bezeichnung/test()")
// Print Actual status and expected status in the log
log.info " Expected Bank name is -> " + expectedBankName
log.info " Actual Bank name is -> " + actualBankName
if (actualBankname && expectedBankName){
content.testCase.setPropertyValue("result","Pass")
}
else {
content.testCase.setPropertyValue("result","Fail")
}
// Find the time by response to come
log.info "Time taken by response is ->" + content.testCase.teststeps["getBank Request"].testrequest.response.timetaken
def timetaken = context.testcase.testSteps["getBank Request"].testrequest.response.timetaken
def timetakeninsec = timetaken/1000
//set the time taken and actual status as test level property so the datasyn can write them in text result in excell fine
content.testCase.setPropertyValue("time",String.valueof(timetakeinsec))
Try changing this line:
def response = context.expand('${#getBank Request#response}')
To this line:def response = context.expand( '${getBank Request#Response}' )
The lower-case r on response needs to be capitalized.
I usually get around this by using a wildcard for the namespace, since in my test-beds the namespaces can fluctuate through environments.
Instead of:
def actualBankName = holder.getNodeValue("//ns1:bezeichnung/text()")
Try this:
def actualBankName = holder.getNodeValue("//*:bezeichnung/text()")