cancel
Showing results for 
Search instead for 
Did you mean: 

Required to manually add ${DataSource Input# in the request body for 170 fields?

SOLVED
Highlighted
New Contributor

Required to manually add ${DataSource Input# in the request body for 170 fields?

Hi all,


First of all, I've read the techcornerchallenge on this, but it doesn't achieve the result that I want.

I love the new functionality of ReadyAPI that you can have a request and it creates the data source properties from that.

The problem for me is the conversion. I have more than 100 fields that need to look like: 

<Name>${DataSource Input#Name</Name> 

<Age>${DataSource Input#Age</Age>

Other than copy-pasting, is there a way in ReadyAPI (or in a different way) to get this done?

 

Thanks in advance!

Frank

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: Request body from the data source-ish ReadyAPI 3.3.1

Hey @frankb 

 

 

yeah - that is tedious and ive had to do it myself - I only have 90 attributes in my request though. 🙂

 

Ok - you mention .wsdl - so this is a SOAP request, right?

 

When I had  this - I didn't try and edit the content in ReadyAPI in your POST/PUT/PATCH/DELETE request's 'Request' nor 'Raw', nor 'Outline' nor 'Form' tabs - it just takes too long.

 

I just copied the whole XML into an editor (XMLSpy, Notepad++ or whatever) and kept the file as a template.

I then edited this and copied (overwriting  the original that was autocreated via adding in a step off a .wsdl) the completed payload into the 'Request' tab on your SOAP test step.  It still takes a little time - but it is waaaaaay quicker than clicking on the different fields in either the 'Outline' or 'Form' tabs.

 

you could do the edit/overwrite within the 'Request' tab itself - but it's alittle awkward and you can't see the full payload without using the vertical scroll bars - its just way easier if you edit it in XMLSpy instead and paste in (overwriting the dynamically generated payload) into the test step's 'Request' tab.

 

Thats exactly what I did - when I had to do this.  Couldn't think of a quicker way of doing it!

 

perhaps someone else has a quicker way of doing it?

 

nice one

 

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

View solution in original post

3 REPLIES 3
Highlighted
Community Hero

Re: Request body from the data source-ish ReadyAPI 3.3.1

Hey @frankb 

 

Im responding cos no one else has - but to be honest - I didn't get what you meant.... can you explain concisely what the problem is please (maybe attach a couple of clarifying screenshots)?

 

guessing on what you meant however, theres pretty much no really quick way around setting up property names - I suppose you might use groovy, but you still need to define the property names somewhere so the work still needs to be done somewhere

 

ta

 

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
New Contributor

Re: Request body from the data source-ish ReadyAPI 3.3.1

Hi Rich,

I struggled a bit with making a subject, but I'll try again 🙂

What I mean is:

I have a datasource with 100 fields. For example name, age, gender, address etc.

My request (because it comes from a wsdl) is:
<name>Name</name>

<age>10</age>

etc.

To make the request work with a datasource I need to change the body of my request to be:

<name>${DataSource Input#Name</name>

<age>${DataSource Input#age</age>

etc.

So far I've been always putting this (${DataSource Input#) manually in the body of the request. Does this mean that I have to do that for 170 fields, or is there a faster/better way? 

Highlighted
Community Hero

Re: Request body from the data source-ish ReadyAPI 3.3.1

Hey @frankb 

 

 

yeah - that is tedious and ive had to do it myself - I only have 90 attributes in my request though. 🙂

 

Ok - you mention .wsdl - so this is a SOAP request, right?

 

When I had  this - I didn't try and edit the content in ReadyAPI in your POST/PUT/PATCH/DELETE request's 'Request' nor 'Raw', nor 'Outline' nor 'Form' tabs - it just takes too long.

 

I just copied the whole XML into an editor (XMLSpy, Notepad++ or whatever) and kept the file as a template.

I then edited this and copied (overwriting  the original that was autocreated via adding in a step off a .wsdl) the completed payload into the 'Request' tab on your SOAP test step.  It still takes a little time - but it is waaaaaay quicker than clicking on the different fields in either the 'Outline' or 'Form' tabs.

 

you could do the edit/overwrite within the 'Request' tab itself - but it's alittle awkward and you can't see the full payload without using the vertical scroll bars - its just way easier if you edit it in XMLSpy instead and paste in (overwriting the dynamically generated payload) into the test step's 'Request' tab.

 

Thats exactly what I did - when I had to do this.  Couldn't think of a quicker way of doing it!

 

perhaps someone else has a quicker way of doing it?

 

nice one

 

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

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors