axasmgaxaOccasional ContributorJoined 6 years ago14 Posts2 LikesLikes received2 SolutionsView All Badges
ContributionsMost RecentMost LikesSolutionsRe: Trying to remove CDATA from response not working Oh yes sure! So the response was returned in JSON; which contained 3 nodes. The 2nd node contained the XML I needed to extract my necessary data; called "suite_id" I set up a property called "XMLData"; and a property transfer. I used the Property Transfer "wizard" to select the 2nd JSON node, via the XPATH path language. I transferred this to the XMLData Property; so this now contains the XML response. From here I set up a new property, "SuiteID", and another property transfer. Using the new property transfer, I was able to extract the SuiteID data from the XMLData property. Again using the XPath language in the property transfer wizard. I transferred the data to my "SuiteID" property. Re: Trying to remove CDATA from response not working Hi nmrao thanks again for taking the time to respond. I moved to another solution for my problem using the property transfer steps to extract the data I need from the response XML. Seems to work just fine! Kind Regards, Steven. Re: Trying to remove CDATA from response not working Thanks for the reply nmrao , when you say it is not appropriate; is that because it won't work? I hope to remove the CDATA tags so that the XML will format properly; can be viewed in the "Outline" tab, and I can manipulate the formatted XML to extract data as needed, as the software was designed to do. If that is not possible I can look at other solutions, but for now, that's what I am aiming to do. Trying to remove CDATA from response not working Hi All, I am hoping someone can help me here! I have have a REST request that is returning a response, which seems to be in JSON format. I don't know much about JSON at all. I can see the XML response also, which contains the "<![CDATA[" tag. I want to remove the CDATA tag, so that I can use the "Outline" tab to extract necessary data from the response. I am using an event handler to replace all; in order to remove the tag but it isn't removing it. The strange part of this is, when I try and remove any other text, that text is removed, which proves the event handler is working. It just won't remove the CDATA tag. Any help would be greatly appreciated! I will attach a snip of the XML tab, and also the code I have in the event handler is below. The event handler is "RequestFilter.afterRequest" def content = context.httpResponse.responseContent content = content.replaceAll( "<!\\[CDATA\\[", "" ) content = content.replaceAll( "]]>", "" ) log.info( content ) context.httpResponse.responseContent = content Thanks in advance. Steven. SolvedRe: Loop Test to Run same test against 3 different endpoints If that is the case, then it's a lack of understanding on my side; which is not surprising as I'm only relatively new to this software! I will have a look into this further. Thanks again nmrao Re: Loop Test to Run same test against 3 different endpoints I have done a good bit of research on this one richie the datasinks work if you use different excel sheets for each one; but that is no use to me unfortunately :smileysad: they are relatively simple tests. 1. data source - read in a date 2 .soap request xml - (uses date above) 3. response - extract two values from the response 4. data sink - output the response values to two specific columns in an excel sheet I had initially hoped, that I could loop this test, and run it against a few endpoints, so that I would get 2 values output from each test. Then, you had suggested setting up the requests individually (your first message). However, the issue with the datasinks meant it would only output the last value extracted. Do you know is there somewhere I can log that as a bug/defect? Re: Loop Test to Run same test against 3 different endpoints nmrao I had a look at your response a little more in depth, and I agree that there is much less coding involved than I initially thought; if any. There is still seemingly no way to loop the cases on the endpoint this way; as in run the same test case each time against 3 endpoints, then move onto the next testcase? I will look into the command line in the future for running my tests, however, I am setting up these tests for someone who may only be comfortable with "point and click", so I have to keep it as simple as possible. Thanks for your help on the matter, you have helped me in the past as well and I appreciate it! Re: Loop Test to Run same test against 3 different endpoints thanks nmrao , I am setting these tests up for another team; so using the UI was the hope, as they may want to maintain/amend the tests and wouldn't be experienced with code. Kind Regards, Steven. Re: Loop Test to Run same test against 3 different endpoints Thanks richie for the reply, this was potentially the best solution, except SoapUI/ReadyAPI really doesn't like more than one datasink in one test case. I set it up as you had described, but only the last datasink outputs data to the excel sheet. (I think that might be a bug with Soap?) I tested it also, I deleted any two of the data sinks and the remaining datasink output data to the sheet. The same happened when any of the data sinks were left. Many Thanks for the response all the same. Re: Is it possible to get Data Sink to write output to excel file horizontally and not vertically? Thanks to everyone who has responded. I don't think it is possible via datasink. (it certainly maybe possible through Groovy, but I am not very proficient with that as of yet.) As a work around, I reshuffled the excel sheet so it will expect the response in vertically.