cancel
Showing results for 
Search instead for 
Did you mean: 

ReadyAPI 3.3.1 - How to load list from excel datasource ?

Highlighted
New Contributor

ReadyAPI 3.3.1 - How to load list from excel datasource ?

I'm trying to make a file for testing using excel, but how to make the data be arranged in this way and be able to import it into a datasource and use the dataloop?

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:out="http://www.test.com">
   <soapenv:Header/>
   <soapenv:Body>
      <out:call_test_sell>
         <out:StoreKey>100</out:StoreKey>
         <out:SaleID>1</out:SaleID>
         <out:OpenDateTime>2020-07-30T10:30:00</out:OpenDateTime>
         <out:Operation>BUY</out:Operation>
         <out:ItemsList>
            <!--Zero or more repetitions:-->
            <out:StrSaleItem>
               <out:ItemID>1</out:ItemID>
               <out:ProductID>1010</out:ProductID>
               <out:Quantity>1</out:Quantity>
               <out:TotalGrossPrice>3.5</out:TotalGrossPrice>
               <out:Cancelation>false</out:Cancelation>
               <out:DateTime>2020-07-30T10:30:10</out:DateTime>
            </out:StrSaleItem>
            <out:StrSaleItem>
                <out:ItemID>2</out:ItemID>
               <out:ProductID>2311</out:ProductID>
               <out:Quantity>1</out:Quantity>
               <out:TotalGrossPrice>9</out:TotalGrossPrice>
               <out:Cancelation>false</out:Cancelation>
               <out:DateTime>2020-07-30T10:30:11</out:DateTime>
            </out:StrSaleItem>
         </out:ItemsList>
         <out:APIDateTime>2020-07-30T10:30:20</out:APIDateTime>
      </out:call_test_sell>
   </soapenv:Body>
</soapenv:Envelope>

 

I tried to arrange the table in repetition of the data of the main object and only change the product object, but the request was not sent iterating the items, but following one by one without grouping.
Ex:

storekeysaleidOpenDateTimeOperationItemIDProductIDQuantityTotalGrossPriceCancelationDateTimeAPIDateTime
10012020-07-30T10:30:00BUY1101013.5false2020-07-30T10:30:102020-07-30T10:30:20
10012020-07-30T10:30:00BUY2231119false2020-07-30T10:30:112020-07-30T10:30:20



Is it possible to make this association with excel or just with groovy?
if so, what would be the expected file layout?


4 REPLIES 4
Highlighted
Community Hero

Re: ReadyAPI 3.3.1 - How to load list from excel datasource ?

Hey @Joao,

Its entirely possible with the dataaource functionality and groovy.
Id go with the datasource functionality if youre not a coder.
Its a soap request, so have you got a .wsdl?
You can load in the .wsdl, create your test steps via the request defined in the .wsdl and paramaterise your variables in a spreadsheet or csv or whatever.

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: ReadyAPI 3.3.1 - How to load list from excel datasource ?

Its entirely possible with the datasource functionality and groovy
Ok
You can load in the .wsdl, create your test steps via the request defined in the .wsdl and paramaterise your variables in a spreadsheet or csv or whatever.

I tried to do it this way, but the SOAP Request does not add items within the product list, it understands how each call with one item instead of a call with 3 items!!

Highlighted
Community Hero

Re: ReadyAPI 3.3.1 - How to load list from excel datasource ?

Hey @Joao,

I dont understand what you mean when you state "but the SOAP Request does not add items within the product list, it understands how each call with one item instead of a call with 3 items!!"???

Whats a "product list"?

What does "it understands how each call with one item instead of a call with 3 items!!" mean? Are you saying the elements in your soapbody are only picking up one value rather than the required number or do you mean something else? You mention 3 items, but the table of record data you mention on your initial post seemed to have a lot more data items per row than 3....?????

This isnt a criticism, but try and remember im not sitting in front of your laptop, nor am i working on your project, so i wont understand if youre using application specific terminology.
If you can clarify your descriptions with some screenshots, thst will help a lot. Screenshots of each test step and the data in spreadsheet as well as screenshots of your soap test step csn only help clarify.

Nice one fella,

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: ReadyAPI 3.3.1 - How to load list from excel datasource ?

Well, sorry for the explanation if it caused confusion, but there’s not much to talk about,

basically the whole situation is like this:

  1. - SOAP Request:
         (xml from question)
    - Excel file with respective data to fill XML of request
         (table from question)

the xml structure contains objects:
[call_test_sell]

-------------- Fields

--------------[ItemsList]
----------------------------[StrSaleItem]

------------------------------------------ Fields
----------------------------[StrSaleItem]

------------------------------------------ Fields

-------------- More Fields


When i use the datasource resource from Excel File the properties extracted is like this:

--------------  call_test_sell Fields

--------------  StrSaleItem Fields

--------------  call_test_sell More Fields


So because everything is in one level by the excel table, the test step of the request ends up making 2 calls when in fact it is a call with a property that has 2 products inside the column.
This make 2 Soap Requests

storekeysaleidOpenDateTimeOperationItemIDProductIDQuantityTotalGrossPriceCancelationDateTimeAPIDateTime
10012020-07-30T10:30:00BUY1101013.5false2020-07-30T10:30:102020-07-30T10:30:20
10012020-07-30T10:30:00BUY2231119false2020-07-30T10:30:112020-07-30T10:30:20

When in fact it should be like this : 1 Request with ItemList

storekeysaleidOpenDateTimeOperationItemsListAPIDateTime
10012020-07-30T10:30:00BUY

[
StrSaleItem(1,1010,1,3.5,false,2020-07-30T10:30:10),

StrSaleItem(2,2311,1,9,false,2020-07-30T10:30:11)
]

2020-07-30T10:30:20

 

Test Case :

Capture.PNG

Captur2e.PNG

What i need to do for the datasource to be able to fill the request with the parameters, do i need to change the file structure ?

Any questions , let me know ,i hope it was clear.

 

New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Compete with community members in the TechCorner Challenge and get into the Leaderboard!

Rank Participant Points Earned
1 msiadak 12
2 nmrao 8
3 HimanshuTayal 3
Top Kudoed Authors