Test case

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

Our Trainer Profile 

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.

  1. Open the browser and type URL https://www.facebook.com/
  2. Click on “Create New Account” button from face book home page
  3. Enter First Name
  4. Enter Sur Name
  5. Enter new password
  6. Select Date of Birth
  7. Select Gender
  8. 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

  1. “System should display confirmation message stating user is created successfully”
  2. User is logged in with newly created user id and home page
  3. 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.

Our Trainer Profile 

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:

Test Cases

Create New Account screen should look like below

types of test cases

System should allow the user to “Create New Account” once user clicks on “Sign Up”

  1. All the fields are mandatory
  2. 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
  3. User should get an email for given email id
  4. User should be logged to face book and home page is displayed

Field level information for Create New Account

First Name:

    1. It can take only letters
    2. If user enters other than letters system should display an error message stating “First Name should be only letters”
    3. It should be a mandatory field
    4. If user leaves first name field empty system should display error message stating “First Name filed is required
    5. It can take maximum of 100 letters
    6. If user enters more than 100 letters then system should display an error message stating “First Name can take max of 100 letters only”
    7. It should have at least 5 letters
    8. 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.

what is test case

Best Manual Testing Online Course

Our Trainer Profile 

Leave a Comment

Your email address will not be published. Required fields are marked *

18 Years Experienced Trainer