cancel
Showing results for 
Search instead for 
Did you mean: 

How can I map a datasource to values in a REST XML content (xml element values)?

SOLVED
Highlighted
Occasional Contributor

How can I map a datasource to values in a REST XML content (xml element values)?

How can I map a datasource to values in a REST XML content (xml element values)?

 

I have a datasource with values; say parm1:value, parm2:value, parm3:value, etc. I have a REST POST request with XML content. I need to map the values in the datasource to the xml elements, so that each request iterates through my datasource (excel document) and fills the xml element values. 

 

I can't seem to find how I map them accordingly. 

Tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: How can I map a datasource to values in a REST XML content (xml element values)?

Take your automated tests in TestComplete to the next level. Pull in data from external sources, repeat it in your test cases, and record the success of each...
8 REPLIES 8
Highlighted
Community Leader

Re: How can I map a datasource to values in a REST XML content (xml element values)?

@tadudek :

 

Please check soapui-how-to-validate-the-actual-result-with-database-result .

 

Hope it will solve you to achieve your problem.

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂

Thanks and Regards,
Himanshu Tayal
Highlighted
Community Hero

Re: How can I map a datasource to values in a REST XML content (xml element values)?

Take your automated tests in TestComplete to the next level. Pull in data from external sources, repeat it in your test cases, and record the success of each...
Highlighted
Community Hero

Re: How can I map a datasource to values in a REST XML content (xml element values)?

Hi @tadudek 

 

if I understand correctly you want to populate a spreadsheet with multiple tag values (multiple for a single POST request) so a single excel file contains all data for multiple tests in a loop?  Is that correct?

 

If you review the following link (and any embedded links within) - this should give you exactly what you need - the link is here

 

Cheers,

 

rich

 

 

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Community Leader

Re: How can I map a datasource to values in a REST XML content (xml element values)?

@richie  : I think by mistaken you have marrked this question as Solved.

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂

Thanks and Regards,
Himanshu Tayal
Highlighted
Occasional Contributor

Re: How can I map a datasource to values in a REST XML content (xml element values)?

@nmrao 

So, I already did go through these. I already watched the video you link as well. Thank you. The video you mention is something about TestComplete. I'm running these tests in SoapUI Pro. I don't have TestComplete. I'm not entirely sure why you think the testcomplete video does anything to describe how to map to a REST XML payload. The other video I found at least has the basics and infers that you can map to the payload, but the tutorial and concepts page do nothing to describe how to map to the XML payload explicitly. 

 

The issue, is that if you have an XML payload, that would get populated by the datasource, it doesn't seem to be possible to populate varying amounts of xml sub-elements that would be 1-*. In example in my first request I have 1 widget to query, and in my second request, I have 3 widgets. My widgets will vary in each request. So, within the XML payload, if you have a schema, you'd see:

 

Datasource record #1: widget:#123

Datasource record #2: widget:#123,widget:#124,widget:#125

 

The widgets here are just reoccurring elements within the widgets elements.

#1: <widgets><widget>#123</widget></widgets>

#2: <widgets><widget>#123</widget><widget>#124</widget><widget>#125</widget></widgets>

 

The tutorials don't provide insight to be able to populate an XML payload that varies #'s of elements by request. Ideally, I'd like to find a way to populate the datasource, and have the test create any number of sub-elements of widgets in this case based on the number of widgets in the spreadsheet. 

 

Thanks! 

 

Highlighted
Occasional Contributor

Re: How can I map a datasource to values in a REST XML content (xml element values)?

Rich, @richie 

 

I posted this in a sepearate response to the "solution". 

 

The issue, is that if you have an XML payload, that would get populated by the datasource, it doesn't seem to be possible to populate varying amounts of xml sub-elements that would be 1-*. In example in my first request I have 1 widget to query, and in my second request, I have 3 widgets. My widgets will vary in each request. So, within the XML payload, if you have a schema, you'd see:

 

Datasource record #1: widget:#123

Datasource record #2: widget:#123,widget:#124,widget:#125

 

The widgets here are just reoccurring elements within the widgets elements.

#1: <widgets> <widget>#123</widget> </widgets>

#2: <widgets> <widget>#123</widget><widget>#124</widget><widget>#125</widget> </widgets>

 

The tutorials don't provide insight to be able to populate an XML payload that varies #'s of elements by request. Ideally, I'd like to find a way to populate the datasource, and have the test create any number of sub-elements of widgets in this case based on the number of widgets in the spreadsheet. 

Highlighted
Community Hero

Re: How can I map a datasource to values in a REST XML content (xml element values)?

Not sure how it happened. Apologies.
https://www.youtube.com/watch?v=AFtyMUiD-5s


Regards,
Rao.
Highlighted
Community Hero

Re: How can I map a datasource to values in a REST XML content (xml element values)?

@tadudek,

Did i? Apologies to all if i did hit the Accept as solution button, i didnt notice. Only thing i can think is that i hit it when i tried hitting the Reply button on my phone.

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
New Here?
Join us and watch the welcome video:
Top Kudoed Authors