How to map repeating elements from xml response to datasink
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to map repeating elements from xml response to datasink
I've been scouring the doc, and I can't seem to find a good answer here.
Is there a way to map a repeating element from a response into a datasink automatically, rather than having to click getData and manually clicking each one?
So, if I have 25 repeating elements. Widgets again. They all have the same attributes. A1, A2, A3. I want my sink to collect each of the attributes from each of the widgets, but I don't want to have to map it explicitly in the data sink property and the every one of the 25 widgets (x3 attributes) in my response.
example:
<widgets> <widget> <att1>abc</att1> <att2>xyz</att2> <att3>asd</att3> </widget> <widget> <att1>abc</att1> <att2>xyz</att2> <att3>asd</att3> </widget> ... </widgets>
In my datasink, I'd like to map these out 1 element to 1 row in excel:
excel row 1 (first widget): att1: abc, att2: xyz, att1: asd
excel row 2 (second widget): att2: abc, att2: xyz, att1: asd
Is there a way to do that?
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is understand there is some customization.
But how it is working with default behaviour when you tried?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's currently just pulling the first widget. Because you have to click, get data, and point to the first widget's attributes to map it to the column in excel. It seems that it'd be a common use case to have repeating elements. I did import a schema for the response, and with the schema, it would know that there are repeats.
I'm guessing I need to write custom groovy to do it.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can write script in what ever way you wanted.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah, I was trying to get around having to write script. I know you can just use a xml map in excel and hit import, but I don't want to do that step manually. Was hoping there was a similar feature.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @tadudek!
If there's any behavior you would like to see in the tool that isn't already there, feel free to create a feature request here.
When you do that, it would be great if you add the link to it to this thread as well so that more people see the request and vote it up.
Sonya Mihaljova
Community and Education Specialist
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've added a feature request. I wasn't sure if I was using the tool correctly, or if I needed to request an enhancement; either way, I put it in! If someone is reading this, please go upvote the feature. 😉
Other similar issues:
- https://community.smartbear.com/t5/SoapUI-Pro/ReadyAPI-Datasink-How-to-save-multiple-rows-from-respo...
- https://community.smartbear.com/t5/SoapUI-Pro/How-can-I-datasink-all-the-values-of-a-given-parent-wh...
