Forum Discussion

Joao's avatar
Joao
New Contributor
4 years ago

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

  • richie's avatar
    richie
    Community Hero
    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
    • Joao's avatar
      Joao
      New Contributor

      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!!

      • richie's avatar
        richie
        Community Hero
        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