◷ Reading Time: 5 minutes
FlexRule Designer is capable of importing data from an Excel file to generate tests case.
FlexRule allows you to import tests data from an Excel file into the Test Case Editor. This feature make it easier to generate tests case from tests data set.
Create a New Test Case Document
You can create the test cases document as follow.
Select the ‘Generic Logic’ file from the ‘Templates’ window and then provide a name for your Test Case document in the ‘Name’ text box. And then click ok.
Select the TestCase file which you created from Project Explorer window and then select the TestCase in the Test Case Editor. To add the Logic file that you have created, click on three dotted lines in the Properties window.
Once you click on the three-dotted line, following Project Explorer window will appear to select your Logic Document. In the Project Explorer window select the logic file.
In the next step, drag a Section element from TestCase Commands in Toolbox window and drop it onto the TestCase.
Preparing Excel File
- The excel sheet should have column headers for each column
- The data that is not relevant to the test results, should be deleted.
This is a sample Excel sheet. For this example we use two columns, one column (Weight) for test input values and other one (Delivery Cost) is for test output values.
Importing The Excel File
Then import the excel file by clicking on the Icon which shows below.
Following window comes up for selecting the Excel file, by clicking on the three-dotted line you can choose the excel file from your computer.
Select the excel file.
Select the sheet that you want to import and click ok.
Once you click ok, the Excel Data Loader window will appear. You can select the role of each column by using the drop-down menu of each column.
Mapping Excel Data
Select parameters from the drop-down which are defined in the Logic File.
Select the cells in the Test row which related to testing output column/s and select Assert from the property dropdown.
Select the data type for each column from the property drop-down.
In any step through importing the excel file, you can see the missing step by clicking on the red alert in the bottom left corner.
Once you click ok, your test cases will be generated in the Test Case Editor Screen. The data are available in the flexrule now.
Run The Test Cases
Select the Section and then click Run Tests button to run your test cases.
When a test has passed successfully, the title bar with green color will be shown.
When a test has failed, the title bar with red color will be shown.