Usage of Excel files¶
Necessary packages and configuration files of the tutorial are distributed with ecu.test and can be used as described here.
This example workspace provides you with examples how you can use excel files to generate test cases. To access the excel files the OpenPyXL libary will be used.
Generate parameter sets¶
Directory |
File |
Description |
|---|---|---|
Packages |
ParamSetGenerator.prj |
Project to start the test execution |
Packages |
DriverRequest.pkg |
Example package which will be parameterized |
Parameters |
DriverRequests.xlsx |
Excel files which includes the parameters |
ProjectGenerators |
ParamSetGenerator.py |
Generator to build the parameter sets |
In this example the Parameter generator for projects is used. Every row in the excel file represents a param set.
Generate packages¶
Directory |
File |
Description |
|---|---|---|
Packages |
TestCaseGenerator.prj |
Project that starts the generator |
Parameters |
SampleTestcase.xlsx |
Excel file (Example of a test specification) |
ProjectGenerators |
PkgGenTestCaseGenerator.py |
Generator to build the packages |
In this example you can see a good combination of the Package generator for projects and Object API to generate whole packages based on an excel file.
Generate Results¶
Additional to generating test cases based on excel data, it is also possible to create test reports in a excel format.
ecu.test provides an example report generator to show you test results in an excel sheet. You can configure this generator in your test configuration under “report” as you can see in the configuration file in this workspace configuration.
It is up to you to customize this generation by copying the generator, located at
<ecu.test installation directory>/Templates/Report/EXCEL, into your current
workspace in your template directory.