In mocks - Karate is throwing com.intuit.karate.core.ScriptBridge.xmlPath(ScriptBridge.java:421) null pointer exception in the xml body path matches

Viewed 22

In mock, I have one scenario :

I have passed xml bodypath like this only earlier it worked, now it is giving me error

Scenario: pathMatches('/some/end/point/v8')
  && methodIs('POST') &&  bodyPath('/xml/path/values/text()') == "4000758341"
  && bodyPath('/xml/path/value/text()') == "2"
  && bodyPath('/xml/request/path/value/text()') == "P"
    * def responseStatus = 200
    * print request
    * def responseHeaders = { 'Content-Type': 'text/xml' }
    * def response  =
"""
"""


But I am getting error - 
 **com.intuit.karate.core.ScriptBridge.xmlPath(ScriptBridge.java:421)
10:06:39.027 [nioEventLoopGroup-3-1] 613209444 WARN com.intuit.karate - scenario match evaluation failed: evaluation (js) failed: pathMatches('/some/end/point/v8')
  && methodIs('POST') &&  bodyPath('/xml/path/values/text()') == "4000758341"
  && bodyPath('/xml/path/value/text()') == "2"
  && bodyPath('/xml/request/path/value/text()') == "P", java.lang.NullPointerException**

Can anyone help me, what i am doing wrong

0 Answers
Related