In the last session, we had discussed about Test Scenario, which is one of the testing terms, and in this session, we are going to discuss another Testing Term which is Test Cases.
Test Case is an extended form of Test Scenario
Test Cases are more detailed description of a Test Scenario in a step by step manner on how to test a Test Scenario.
Test Scenarios are just one liner statements whereas Test Cases are detailed explanation of Test Scenarios.
Test Cases is set of Steps, inputs and expected result.
A test case typically includes information such as the test case ID, the test case description, the test input data, the expected output, and any other relevant information necessary to execute the test successfully.
We need to follow some steps when we are writing Test Cases, First of all We should know that Test Cases are derived from Test Scenarios.
So, This is how, We write a Test Case.
Below is the format of a typical Test Case.
We had written some Test Scenarios in our last session for a Calculator Application, So we are going to write Test Cases for few of those Scenarios here.
Test Name or Test Case Description | Step No | Description of the Step | Expected Result |
Add 2 Numbers | 1 | Launch Calculator Application on the Desktop | Calculator App is launched successfully |
2 | Type a number say 2 | Number is entered | |
3 | click on + sign | (+ Sign is clicked) | |
4 | Type a number say 3 | Number is entered | |
5 | click on = sign | Result of the addition is displayed which is 5 | |
Add 3 Numbers | 1 | Launch Calculator Application on the Desktop | Calculator App is launched successfully |
2 | Type a number say 2 | Number is entered | |
3 | click on + sign | (+ Sign is clicked) | |
4 | Type a number say 3 | Number is entered | |
5 | click on + sign | (+ Sign is clicked) | |
6 | Type a number say 4 | Number is entered | |
7 | click on = sign | Result of the addition is displayed which is 9 |
Now, Let’s write the Test Cases for eCommerce Application, for which we had written Test Scenarios in our last session.
Test Name or Test Case Description | Step No | Description of the Step | Expected Result |
Test the search functionality for Jeans and verify PLP Page displays only Jeans Products | 1 | Launch eCommerce Website | eCommerce Website is launched successfully |
2 | Search for Jeans | Validate PLP Page displays Jeans Products only | |
Test the PDP Page displays correct product description, pricing information, size and color information for a product | 1 | Launch eCommerce Website | eCommerce Website is launched successfully |
2 | Search for Jeans | Validate PLP Page displays Jeans Products only | |
3 | Click on any of the Product | Validate PDP Page displays with correct product description, pricing, size and color information of the product |
So, This is how, we write Test Cases.
Below are few differences between Test Scenario and Test Case
Test Scenarios | Test Cases |
Test Scenario is High Level Documentation | Test Case is a very detailed Documentation |
Test Scenario is a 1 liner Statement | Test Case contains many steps and many other components such as Test Name, Description of the Steps and Expected Result. |
Test Scenario is derived from Requirement | Test Case is derived from Test Scenario |
Test Scenario doesn’t contain data | Test Case contain data to be tested |
Test Scenario is all about what to test | Test Case is about what to test and how to test |
It takes less time to prepare Test Scenarios | It takes more time to prepare Test Case |
Test Scenario cover a broad range of functionality | Test Case is very specific while checking a functionality |
We have discussed below topics today
Write Test Cases for all the Test Scenarios, We have discussed in our Test Scenario Session.
Why we can not over ride a Constructor This is a very important question, that,…
What is Arrow Function In the last session, We had discussed about Anonymous Function. Anonymous…
What is Anonymous Function Anonymous Function is a type of function which has no name…
What is Map, Reduce and Filter Map Filter and Reduce are higher order methods for…
9 different ways of declaring or defining a function in Javascript In, one of our…
Loops with Arrays in Javascript In our last session, we had seen, What is Array…