What is Test Case?
Test Case is a document which helps tester to do the testing with detailed steps. Test Case contains detail steps on how to test the functionality of the system / product.
Test Case Contains below:
- Test case Name
- Sr No
- Test step
- Test Data
- Expected results
- Actual Results
- Status
- Defect or Bug Id
- Comments
- Executed by
- Execution date
Best Manual Testing Online Course
Let’s understand each one of them in detail
Test Case Name: Every test case will have unique name and test case name helps in understanding what we are trying to test from this test case. Let’s say you are writing test case for Facebook application for creating new account. We can write test case name as “Verify user is able to create new account” as you guys see here name Easley tells to us that this test case is going to test the functionality of creating new account. I have written test cases as well for this in below.
Test Step: A test case contains multiple steps. Let’s take same above test case “Verify user is able to create new account” here in order to create new account with face book you need to follow multiple test steps.
I mean you need to follow below steps and you will write all of below steps in your test case.
- Open the browser and type URL https://www.facebook.com/
- Click on “Create New Account” button from face book home page
- Enter First Name
- Enter Sur Name
- Enter new password
- Select Date of Birth
- Select Gender
- Click Create Sign-Up button
Test Data: Every Test Case will have Test Data which is nothing but what data you are going to enter in your application. Let’s take same above test case “Verify user is able to create new account” as given test steps above for every test step you need to enter test data. I mean for step 1 where we say open browser and type URL we need to enter test data as https://www.facebook.com/
Same for step 3 where you say Enter First Name here you need to enter some First Name like “Ashok” which is going to be your test data.
So wherever you see you need to enter some data in fields you need to specify what data needs to be entered in that in test data of your test case.
Expected Result: For every test step you will have expected result. Here we try to validate every test step output is displayed as per requirement given in SRS / BRS / User Story. In simple term what is expected response from application for each step.
Let’s take same test case “Verify User is able to create new account”.
Look at test step 1 from above test case where we say “open browser and type URL https://www.facebook.com/.”Here what are we expecting once face book homepage opened. We expect that face book home page is displayed as per the requirement given in SRS / BRS document. This will be your expected result.
Let’s look at test step 6 “Click Create Sign-Up button”, what do you expect as response from face book application. We expect below as our expected result as per given in SRS / BRS document
- “System should display confirmation message stating user is created successfully”
- User is logged in with newly created user id and home page
- System should send an email to user with given email template given in SRS / BRS / User Story
Actual Result: Here we try to see what actual response from the system is. We write Expected Result as per requirement given in SRS / BRS / User story. But your Actual Result can be same as per requirement OR may be different. If we see Actual Result is not matching with Expected Result we call it as a bug because system is not behaving as per the expectation given by client. So we go and create a defect in defect management tool. We need to make sure Actual Result is matching with Expected Result but not vice versa.
Best Manual Testing Online Course
Status: Here we are going to write whether test case is pass / fail / blocked. If we see both Expected Result and Actual Result are same then we are going to write status Pass. If we see Actual Result is not matching with Expected Result then we write status as Fail. If you are not able to execute this step due to defect then we going write status as Blocked.
Comments: Here we enter comments if we have any on blocked / failed test steps to explain more on why your test step is blocked / failed
Executed By: Here we enter tester name whoever is executing test case.
Types of Test Cases:
GUI ( Graphical User Interface): Here we write the test cases to validate the User Interface of the application / system / product. Here we need to check for below:
- Check screen is appearing as per the screen shot given in SRS / User Story
- Check for spelling mistakes
- Check for alignment issues
- Check for capital / small letter issues
- Check any space issues
Functional Test Case: Here we write the test cases for to test the functionality of the application
- Filed Level Validation: Here we write the test cases to validate below
- Check for mandatory data validation
- Check maximum size of the field
- Check for minimum size of the field
- Check for invalid data
So far we understood what is Test Case and Types of Test Cases. We always write test cases by looking at SRS (Software Requirement Specification) OR by looking at User Stories.
Before writing test cases let’s consider you are working for FaceBook application and below are few requirement details from SRS OR from User Stories. Let’s say that you guys are working or facebook application as a tester role. Below are the requirements from the client
Facebook home page should look like below:
Create New Account screen should look like below
System should allow the user to “Create New Account” once user clicks on “Sign Up”
- All the fields are mandatory
- System should display an confirmation message stating “User account is created successfully” once user enters all the required details and clicks on Sign Up button
- User should get an email for given email id
- User should be logged to face book and home page is displayed
Field level information for Create New Account
First Name:
-
- It can take only letters
- If user enters other than letters system should display an error message stating “First Name should be only letters”
- It should be a mandatory field
- If user leaves first name field empty system should display error message stating “First Name filed is required
- It can take maximum of 100 letters
- If user enters more than 100 letters then system should display an error message stating “First Name can take max of 100 letters only”
- It should have at least 5 letters
- If user enters less than 5 letters then system should display an error message stating “First Name should have at least 5 letters”
System should not allow to create duplicate user
System should not allow to create duplicate user
System should not allow to create user if users date of birth is <18 years
System should not allow to create user if users date of birth is <18 years
We always write test cases in Test Management Tool (I will add topic on this in my blog as well). We have so many tools available in the market to write test cases and most of them are kind of similar. So if you learn one that should be fair enough to work on other tools as well.
Now let’s write one test case for requirement / user story called “Create New Account screen should look like below”.
I have taken capture of test chase which I have written in Excel. Please increase your browser Zoom to view more clearly.