0
以下值我有以下SOAPUI其餘輸出:試圖從REST的響應(SOAPUI)
<html>
<head>
<meta content="HTML Tidy for Java (vers. 26 Sep 2004), see www.w3.org" name="generator"/>
<title/>
</head>
<body>
{"message":{},"records":[{"Application Name_2":"DO NOT DELETE: QA Regression Test","Status ID_5":"13160","Email_6":"","ListFiles Webservices_4":"
<a download="download" href="/" target="_blank">Test.txt<\/a>,</a>
<a download="download" href="/" target="_blank">TestTwo.txt<\/a>","# Index_1":"1","DownloadFile Webservices_3":"</a>
<a download="download" href="/" target="_blank">Test.txt<\/a>"}],"header":[{"index":"1","name":"# Index","numformat":"","type":"string"},{"index":"2","name":"Application Name","numformat":"","type":"string"},{"index":"3","name":"DownloadFile Webservices","numformat":"","type":"string"},{"index":"4","name":"ListFiles Webservices","numformat":"","type":"string"},{"index":"5","name":"Status ID","numformat":"","type":"string"},{"index":"6","name":"Email","numformat":"","type":"string"}]}</a>
</body>
</html>
我試圖提取Test.txt的,但未能如願。
這是我曾嘗試:
//imports
import groovy.json.JsonSlurper
//grab the response
def ResponseMessage = messageExchange.response.responseContent
//define a JsonSlurper
def jsonSlurper = new JsonSlurper().parseText(ResponseMessage)
def FieldDownloadFile = jsonSlurper.records.'DownloadFile Webservices_3'
log.info FieldDownloadFile
,這就是我能提取:
[<a target=_blank href="/files/spool/493500/1133476/1_2866521_1133476_Test.txt?fs=1" download>Test.txt</a>]
但是我只想提取物 - Test.txt的
似乎有多個地方,您想要哪一個地方? – Rao
@rao,有可能有第一個嗎? – user7242550