4.3.5.Handling CDATA - using XPath and Groovy
1. CDATA
嵌在XML裡面的區塊, 可以是XML, 也可以是其他資訊
搭配Groovy來parsing
無法用一般的方式parsing
2.Parsing CDATA
1.Add Assertion-> Property Content -> XPath Match

2.點選Declare
3.填上路徑
e.g.,
<getAirportInformationByAirportCodeResponse xmlns="http://www.webserviceX.NET"> <getAirportInformationByAirportCodeResult><
2.重新命名Test step: 改為getAirportInformationByAirportCode

3.編輯script
context.expand放的字串順序為: Test step名稱#Response#declare...;//ns1
用groovy.util.XmlSlurper來parse出想要得到的key
Last updated
Was this helpful?