Verify Element property value keeps failing

I have set up a grab from our Soap service that produces the response (in Part)

<env:Envelope xmlns:env=“”>



<ns0:modemMTAPollResponse xmlns:ns0="">











In the test itself I have:

response = WS.sendRequest(findTestObject(‘WHC SOAP/modemMTAPoll’, [(‘MAC’) : ‘083E5DF9E7C0’]))

WS.verifyResponseStatusCode(response, 200, FailureHandling.STOP_ON_FAILURE)

WS.verifyElementPropertyValue(response, ‘ns0:modemMTAPollResponse.modemMTAPollResult.modemIsPollable’, ‘true’)

I get the following Error:

09-13-2018 05:54:13 PM - [FAILED] - Unable to verify element property value (Root cause: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

Script1.groovy: 1: unexpected token: ns0 @ line 1, column 5.

def ns0:modemMTAPollResponse = new XmlSlurper().parseText(xmlText);return ns0:modemMTAPollResponse.modemMTAPollResult.@modemIsPollable


1 error


I have tried the locator a number of different ways and why I drop the first element it tells me that element is not found.

I am stumped and am now banging my head against my desk. Can anyone offer some insight? I fear its my own inability to understand something fundamental in the locator.


You seem to have spotted a weak point in Katalon Studio with respect to XML Namespace in XML Response.

In Andrew’s case, the SOAP response body contains nodes with XML Namespace (xmlns:ns0=“”). On the other hand, Katalon Document describes a case where SOAP response body contains nodes without XML Namesapece.

With or Without XML-Namespace, this difference is quite significant for application which digests XML documents.

The following line is, I am sure, very problematic:

   def ns0:modemMTAPollResponse = new XmlSlurper().parseText(xmlText);

This message indicates that Katalon naively assumes that it can use the XML Element name (ns0:modemMTAPollResponse) as a variable name in Groovy. But colon character ( : ) is not valid as a component of variable name in Groovy. Therefore compilation error occurs.


Your SOAP service is responding this way:

    <ns0:modemMTAPollResponse xmlns:ns0="">        <modemMTAPollResult>

To me, this response looks odd. I guess, your SOAP service might be still in development and could have some fault.

Is it possible to change your SOAP service so that it responds in the following way?

    <modemMTAPollResponse>        <modemMTAPollResult>


    <modemMTAPollResponse xmlns="">        <modemMTAPollResult>


<env:Envelope xmlns:env="">
    <ns0:modemMTAPollResponse xmlns:ns0="">

I found that by default XMLSlurper is not XML-Namespace aware. This can be turned on by declaring namespaces with the declareNamespace Method.

It is likely that Katalon is calling XMLSlurper without calling declareNamespace method.

Assuming that the XML-Namespace xmlns=“” is important, then the following format of SOAP response would be best friendly to Katalon:

<env:Envelope xmlns:env="">  <env:Header/>  <env:Body>    <modemMTAPollResponse xmlns="">      <modemMTAPollResult>        <modemCmtsMac/>        <modemDhcpServerIp>        </modemDhcpServerIp>        <modemFoundOnCmts>true        </modemFoundOnCmts>        <modemHasMta>true        </modemHasMta>        <modemIsPollable>true        </modemIsPollable>...

I suppose you can work-around the compilation error caused by a collon (:slight_smile: character in variable name.

Anyway, I mean, you need to change your SOAP service in order to test it with Katalon Studio. :wink:


Do you really need XML Namespace “” applied to the SOAP response? Just I doubt it.

I would suggest to you to discuss with your development team if it is necessary or not.