Forum Discussion

Sharmila's avatar
Sharmila
New Contributor
10 years ago

I need to combine two responses(1,2,3 & 4,5) and make it as a single response like 1,2,3,4,5

Hi,

I am getting the below two responses.

 

a =  record1.unaligned.e[i]  

Result will be : CharName: Brand, Size: 40, Shape: Cube.
 b =  record1.masterlist.e[i]

Result will be: CharName: Volume, Size: 60, Shape: Triangle.

 

And i need to make a & b in a same response like

CharName: Brand, Size: 40, Shape: Cube

CharName: Volume, Size: 60, Shape: Triangle.

 

Please help me with this in groovy script

3 Replies

  • nmrao's avatar
    nmrao
    Community Hero
    Would it be possible for you to show the available input expected output xmls?
      • nmrao's avatar
        nmrao
        Community Hero
        Thank you for the attachment.
        Could not see the xml structure of unaligned, can only see masterlist. Does unaligned look exactly same as masterlist? or can you show it?
        Also is it possible to show the jdbc result as xml if not full, just one record.
        From the test case, I see datasource loop which does not seem to be required based on what I see? Can be removed if not required.

        All the records of db as well as xml response can be verified/compared in just groovy script.
        If I have to do this - here is what I follow:
        1. Read the xml response, and create data objects by using class/model
        2. Same as above for jdbc response data
        3. Now compare both the objects, loop thru the list of both types.