Contributions
Re: Able to modify JUNIT reports to include Request/Response for failed cases
Hi, We had the same issue, and customising JUNIT reports would be nice but you can do that today with the standard groovy assertion output options: using a semicolon after the assertion result: assert assert_flag : "\nRequest: " + messageExchange.getRequestContent().toString() + "\nResponse: " + messageExchange.getResponseContent().toString()4.2KViews0likes0CommentsRe: Strip Out UTF-8 BOM out of responses
Hi all, Ihad this problem recently and here is how I solved it: Add a RequestFilter.afterRequest event and use the code below. The code strips the first char from the response. It doesn't check if the char is indeed the BOM, but strips it if the encoding is UTF-8. This assumes you always know your UTF-8 responses contain the BOM. Be careful with the script, it will run for every request that you send. Add other exit conditions to the begining of the event that suit your purpose. if( context.httpResponse.responseContent == null ) return if(context.httpResponse.responseHeaders.get("Content-Encoding").toString() != "[utf-8]") return // get response content def content = context.httpResponse.responseContent // manipulate content // remove the first char from the response (in this case the utf-8 BOM) content = content.substring(1,content.length()) // write it back context.httpResponse.responseContent = content10 years agoPlace ReadyAPI QuestionsReadyAPI Questions1KViews1like0Comments