Skip to content

Tutorial: Use mass test data

iks github user edited this page Jul 9, 2019 · 13 revisions

Back


In some cases the same executable example has to be executed for a large number of datasets. Instead of doublicating this executable example for each data set, it is much more efficient to use parametrized tests and to store the test data in Excel files.

  1. Open file "./sysnat.natural.language.executable.examples/ExecutableExamples/GoogleSearch/WebPageCheck.nlxx".

  2. Dublicate an existing executable example and give the new executable example the name "Parametrized Web Page Check".

  3. Replace line 'TestData: GoogleSearchSysNat' by the new line 'Test-Parameter: GoogleSearchMassData'.

  4. Create new Excel file "./sysnat.natural.language.executable.examples/testdata/GoogleSearch/GoogleSearchMassData.xlsx".

  5. Open excel file and enter the following data with the root cell at postition A1:

     |root cell            |SearchText         |ExpectedSearchResultText1           |ExpectedSearchResultText2                                   |
     |GoogleSearchMassData1|SysNat             |https://github.com/iks-github/SysNat|Operate your software system                                |
     |GoogleSearchMassData2|IKS GmbH           |https://www.iks-gmbh.com            |IKS GmbH: Individuelle Softwareentwicklung und IT-Beratung  |
     |GoogleSearchMassData3|Clean Coding Cosmos|clean-coding-cosmos.de/             |Clean Coding Cosmos | mit Jörg Vollmer und Dr. Reik Oberrath|
    
  6. Start SysNat and check test report.

  7. Delete Excel file and create the new file "./sysnat.natural.language.executable.examples/testdata/GoogleSearch/GoogleSearchMassData.dat" with following content:

     SearchText=SysNat
     ExpectedSearchResultText1=https://github.com/iks-github/SysNat
     ExpectedSearchResultText2=Operate your software system
     -
     SearchText=IKS GmbH
     ExpectedSearchResultText1=https://www.iks-gmbh.com/unternehmen/
     ExpectedSearchResultText2=Unternehmen | IKS GmbH - Hilden
     -
     SearchText=Clean Coding Cosmos
     ExpectedSearchResultText1=clean-coding-cosmos.de/
     ExpectedSearchResultText2=Clean Coding Cosmos | mit Jörg Vollmer und Dr. Reik Oberrath
    
  8. Start SysNat and check test report for the same results.


Back

Clone this wiki locally