Forum Discussion

gtourian's avatar
gtourian
New Contributor
7 years ago

Looping the execution of a test, using a different spreadsheet data source each iteration?

We have a need to verify data via the GUI of our application with changed customer data contained in Excel Spreadsheets.  We will get dozens to hundreds of these spreadsheets per month, each from an individual customer.

 

Is it possible to set up any test script to loop iterations, but grab a different spreadsheet file each iteration.  Obviously, there would need to be a master file list or some config file that tells the script which files to use, or the like.

 

Thanks in advance for any assistance you can provide.

3 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    You could set up a variable that contains the name of the data sheet and iterate through the names if they are similar.

     

    Another option would be to set up an additional spreadsheet with the names of the data sheets and read through them that way.  Might be easier because you could have useful names on them too.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I'm assuming that these spreadsheets are all in the same drive folder location?  What you could do is use aqFileSystem.FindFiles to bring back an iterative list of the spreadsheets and then loop through that to do the comparisons.

  • NisHera's avatar
    NisHera
    Valued Contributor

    It's possible as per tristaanogre $ Marsha_R and it's easier with automation tests rather than manually.

    But one other thing you have to be aware,

    if the way of entering data defferent from each other (spread sheets) you may have to write test accordingly (and comparatively complex)

     

    you may do like 

    DDT.ExcelDriver(yourVariable+"\\.xlsx","sheet1",true);
      do
      {
        test code gos here...or just call a test to enter data
         
      }
      while (!(DDT.CurrentDriver.EOF()));
      DDT.CloseDriver(DDT.CurrentDriver.Name);

    yourVariable = filepath and name