When I run a REST request, my answer is
HTTP / 1.1 204 No Content Date: Fri, Oct 01, 2010 5:18:11 PM GMT X-Response-ID: 10016
How to check it? Because it's a headline, I think. How to add a statement for this? When i decloare
You can use the method of messageExchange.responseHeaders[field] to access the HTTP header fields, such as #status*, Content-Type, Accept, etc.
messageExchange.responseHeaders
#status*
Content-Type
Accept
def http_status = messageExchange.responseHeaders["#status#"][0] assert http_status.contains("204")
import com.eviware.soapui.support.XmlHolder def holder = new XmlHolder( messageExchange.responseContentAsXml ) def node = holder.getDomNode( "//data[1]/@contentType" ) assert node != null assert((com.eviware.soapui.support.types.StringList)messageExchange.responseHeaders["#status#"]).containsValue("HTTP/1.1 204 No Content")