[SoapUI] 比较两个不同环境下XML格式的Response, 结果不同时设置Test Step的执行状态为失败

import org.custommonkey.xmlunit.*

def responseTP=context.expand( '${Intraday Table_TP#Response}' )

def responseLive=context.expand( '${Intraday Table_Live#Response}' )



if (responseTP == responseLive)

{

     log.info "Test case pass"

     assert true

}

else{

	log.info "Test case failed"



	def xmlDiff = new Diff(responseTP, responseLive)

	assert xmlDiff.identical()

}

或者简洁一点,直接去比较就好了

import org.custommonkey.xmlunit.*

def responseTP=context.expand( '${Intraday Table_TP#Response}' )

def responseLive=context.expand( '${Intraday Table_Live#Response}' )



def xmlDiff = new Diff(responseTP, responseLive)

assert xmlDiff.identical()

  

你可能感兴趣的:(response)