Data Set / Test Data
Data set stores the data files, Script reads test data from external data sources and executes test based on it.
Typically the data input can be anything:
- MS Excel files
- Data base
- Text files
- XML files….etc.
External test data must be easily editable by test engineers without any programming skills. Excel files are the ones that used most often and are familiar with it.
Data sets increases test coverage by performing testing with various inputs and reduce the number of overall test scripts needed to implement all the test cases
Data Set / Test Data Examples
The below is the excel sheet for "Add User with Valid Data"
In the above sheet, we are trying to add two records by filling all the fields. After entering the data in respective fields and clicking on submit button, it will display a success message which tool will get and compare with Actual and Expected.
The below is the excel sheet for "Add User with invalid Data"
In the above example, we are trying to add four records with invalid details.
For the First row, we are passing an empty 'first name' which is a required field. When we click on submit button, it will display a message as 'Please enter first name'. We should now validate if the message displaying is as expected.
Why and How to use Data Set / Test Data:
We use test data to increase test coverage with valid and invalid data.
Say suppose, if there are 20 fields in the application. And we need to check different cases by passing different values.
If there are fields related to banking information, we need to validate and restrict the user not to enter junk or invalid data.
There are cases were you may need to check calculation / percentage by adding more number of records. In such cases we have to use data set and pass different values.
We need to make sure to identify the number of fields in the function / page and define the number of columns. On the basis of these columns, data will be provided to input fields in the application.
We should define a column called Output and provide the respective message based on the data provided by the user. To provide the result/status, tool should compare with expected and actual results. Here the output is nothing but the expected. Tool will get the actual and compare with the expected data provided by the user.