ContributionsMost RecentMost LikesSolutionsRe: call a rest api when a functional test fails hi, We wrote the following groovy script using the TestRunListener.afterrun event, but this script works rest abi whether the test automation is successful or not. What can I do to make it work only when it fails. import java.io.BufferedReader import java.io.InputStreamReader import java.net.HttpURLConnection import java.net.URL def restApiUrl = "URL" def url = new URL(restApiUrl) def connection = url.openConnection() as HttpURLConnection connection.requestMethod = "GET" if (connection.responseCode == HttpURLConnection.HTTP_OK) { def response = new StringBuffer() def reader = new BufferedReader(new InputStreamReader(connection.inputStream)) String line while ((line = reader.readLine()) != null) { response.append(line) } reader.close() println("REST API Yanıtı: " + response.toString()) } else { println("REST API çağrısı başarısız: " + connection.responseCode + ", " + connection.responseMessage) }connection.disconnect() call a rest api when a functional test fails hi, I need something like this. when an error is received in a step of the function test, I want it to call a rest api. the reason for this is that this rest api will send sms to my cell phone. I could not find how to do it. can you help. regards... Re: how to replace encoding information in xml hi sonya_m no i can't solve my problem. This problem needs to be solved with the event, but I cannot get support in this regard. I opened a case about it. we cannot find a solution. Re: how to replace encoding information in xml hi HimanshuTayal I shared how I use the script in the screenshots below. I see the script working correctly. There is a situation like this, as seen in the second picture, I cannot transfer the value of the property transfer to the other webservice. 2.picture Re: how to replace encoding information in xml hi HimanshuTayal I did not understand where to use this script. can you specify that too. thank you. Re: how to replace encoding information in xml hi nmrao I don't use soap ui without replacing xml Re: how to replace encoding information in xml hi richie yes.I write the details below. 1. SubmitListener.afterSubmit a. script is working when I run it manually. (I put the screenshot below) b. When I run the script automatically, the test suite doesn't work. 2. we tried to solve this problem using RequestFilter.afterRequest but it doesn't work at all (a and b). I hope I haven't confused you more. I would be very happy if you could help me Re: how to replace encoding information in xml hi richie submitlistener.aftersubmit works as below so I use it like this for requestfilter.afterrequest. but submitlistener.aftersubmit does not work automatically in test suite. we got support for this but we couldn't find a solution. (submitlistener.aftersubmit) I thought I could use the after request as a solution. so I wrote here for support. def content = submit.response.responseContent content = content.replaceAll("<!\\[CDATA\\[", "") content = content.replaceAll("\\]]>", "") content = content.replaceAll("<\\?xml version=\"1.0\" encoding=\"iso-8859-9\"\\?>", "") log.info (content) submit.response.responseContent = content I would really apreciate if you help thanks. how to replace encoding information in xml Hi everyone, I use this to replace redundancy using XML. event>requestfilter.afterrequest def content = context.httpResponse.responseContent log.info content content = content.replaceAll( "<!\\[CDATA\\[", "" ) content = content.replaceAll( "]]>", "" ) content = content.replaceAll("<\\?xml version=\"1.0\" encoding=\"iso-8859-9\"\\?>","") log.info content context.httpResponse.responseContent = content Code replace CDATA but does not replace("<\\?xml version=\"1.0\" encoding=\"iso-8859-9\"\\?>","") can you help me please... xml response: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Body> <ns1:alisverisBaslatResponse SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="WsOtomotiv"> <return xsi:type="xsd:string"><![CDATA[<?xml version="1.0" encoding="iso-8859-9"?><XmlString><SONUC>1</SONUC><DURUM>0</DURUM><ACIKLAMA>Basarili Alisveris</ACIKLAMA><TRXNO>20061701011000001710</TRXNO><INDIRIM><YENIAVTUTAR>500,00</YENIAVTUTAR><DKID></DKID><DKAD></DKAD><DKKP></DKKP><DIPINDTUTAR>0,00</DIPINDTUTAR><URUNINDIRIMLIST><URUNINDIRIM><UKID>20200</UKID><UKAD>DIVAN</UKAD><UKKP>60</UKKP><URUNKOD>A</URUNKOD><UINDTUTAR>500,00</UINDTUTAR></URUNINDIRIM></URUNINDIRIMLIST></INDIRIM><KPAROPUAN>35,00</KPAROPUAN><TPAROPUAN>35,00</TPAROPUAN><HARCAMADURUM>1</HARCAMADURUM><IZINDURUM>1</IZINDURUM><KAYITDURUM>2</KAYITDURUM><VERDEKOD>18259294</VERDEKOD><ISYERIPUAN>0,00</ISYERIPUAN><ADSOYAD></ADSOYAD><URUNINDIRIMTARIHLIST><URUNINDIRIMTARIH><UKID>20200</UKID><UKAD>DIVAN</UKAD><BASLANGIC_TARIHI>18-01-2013</BASLANGIC_TARIHI><BITIS_TARIHI>30-12-2033</BITIS_TARIHI></URUNINDIRIMTARIH></URUNINDIRIMTARIHLIST></XmlString>]]></return> </ns1:alisverisBaslatResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Solved