Table of contents
1.
Introduction
2.
Authentication Testing Cases for a Login Page
2.1.
Elements of a Login Page
2.2.
UI Test Cases for a Login Page
2.3.
Functional Test Cases for a Login Page
2.4.
Non-functional Test Cases for a Login Page
2.5.
CAPTCHA Test Cases for a Login Page
3.
Authentication Testing Cases for a Sign-Up Page
4.
FAQs
5.
Key Takeaways
Last Updated: Mar 27, 2024

Authentication Testing

Author Parth Jain
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

While trying to access a social media platform, we are often welcomed with a login page. The purpose of this login page is to authenticate if the User is the actual person to whom the social media account belongs. In other words, the authentication procedure prevents trespassers from accessing private information.
There is no doubt that Authentication Testing is a compulsory procedure in today's world.
Some crucial benefits provided by Authentication Testing are:

  • It prevents trespassers from accessing a website.
  • Provides the users a sense of security
  • Helps to maintain user privacy
  • Prevents Cyber Frauds
     

Now that we know what Authentication Testing is and how necessary it is, we as developers must understand what all test cases must be fulfilled while creating a login page for a website.

Also See, Locators in Selenium

Authentication Testing Cases for a Login Page

While writing the test cases for a login page, the following types of cases are considered:

  • Positive and Negative test cases.
  • Functional and NonFunctional test cases.
  • UI, compatibility, and performance-based test cases.
  • Test cases for each login page element

Elements of a Login Page

While testing a Login Page, the following elements should be created:

  • Username/Phone Number/Registered Email ID Input Field
  • Password Input Field
  • Login Button
  • Remember Me Checkbox
  • Forgot Password Link
  • Sign up/Create new account Link
  • CAPTCHA

UI Test Cases for a Login Page

  • Verify that the login page screen contains all the previously discussed elements such as Username, Phone Number, Registered Email, Password, Sign in button, Remember Me check box, Forgot password link, and a create a new account link.
  • Verify that a valid placeholder is assigned to all the fields such as Username, Email, and Password.
  • Verify that a minimum and the maximum character limit are assigned to all the text boxes.
  • In the case of a floating label, verify that the label floats upwards while the text field is focused or filled.
  • Verify that the font size and decorations are visible and do not overlap with any other field.
  • Verify that the media queries work for different screen resolutions to support all devices.
  • Verify that the login page works perfectly in different browsers.

Functional Test Cases for a Login Page

  • Verify that on page load, the mouse cursor is focused on the Username text field by default
  • Verify that the text field switching functionality using the tab key is working or not
  • Verify that Enter key works as a substitute for clicking the Sign-in button
  • Verify that the User can Login with Valid Credentials
  • Verify that the User is unable to Login with an invalid Username or Password
  • Verify that the User is unable to log in with a Valid Username but an invalid Password
  • Verify that the User is unable to log in with an invalid Username but a Valid Password
  • Verify that the User is unable to log in with a blank Username or Password
  • Verify that the User is unable to Login with expired or inactive credentials
  • Verify that all data from the text boxes on the login page is cleared upon pressing the reset button.
  • Verify that the login password is stored in an encrypted format inside the database
  • Verify that upon successful Login, the back button of the browser should not log out the User.
  • Verify that if the User leaves the Username or Password field as blank, a validation message is displayed.
  • Verify that in case of the character limit is exceeded for the Username and Password fields, a validation message is displayed.
  • Verify that in case of entering a special character in the Username and Password fields, a validation message is displayed
  • Verify that the “Remember Me” checkbox is unchecked by default 
  • Verify that the logout link redirects to the home page
  • Verify that the User is redirected to an appropriate page after successful Login
  • Verify that the User is redirected to the Forgot password page after clicking the Forgot Password link
  • Verify that the User is redirected to the Create a new account page after clicking the Create new account link
  • Verify that the User can log in using a new password after changing the old password
  • Verify that the User is unable to log in with an old password 
  • Verify that spaces inside the password field should not be allowed 
  • Verify the ways to retrieve the password if the user forgets the password

Non-functional Test Cases for a Login Page

  • Verify that the user is not redirected to a logged-in mode after clicking the browser back button after a successful logout event
  • Verify that there is a limit to the total number of unsuccessful login attempts 
  • Verify that while typing the password inside a password field, the text is in an encrypted format (Password appears as a string of asterisks *)
  • Verify the password cannot be copy-pasted. 
  • Verify if the login form is revealing any security information by viewing the login page source
  • Verify that the login page is vulnerable to SQL injection.

CAPTCHA Test Cases for a Login Page

  • Verify that if the User fails to enter the CAPTCHA, there is a client-server validation. 
  • Verify that a new CAPTCHA is generated upon pressing  the refresh link 
  • Verify that the CAPTCHA is case sensitive
  • Verify that the CAPTCHA has audio support to listen
  • Verify whether the virtual keyboard is available 
  • Verify two-factor authentication through OTP(One Time Password) is working in the case of banking applications.
  • Verify SSL certificate is implemented or not
  • Verify that the User can Login when the browser cookies are cleared
  • Verify the login functionality in case the browser cookies are turned off.

Authentication Testing Cases for a Sign-Up Page

  • Verify that there is a message displayed for each mandatory field
  • Verify if without filling all the mandatory fields, the User cannot proceed
  • Verify the age of the User in case the DOB is selected
  • Verify that in the First and Last name fields, the numbers and special characters are not allowed 
  • Verify that the User can sign-up successfully with all the mandatory details
  • Verify that the user can log in with the valid credentials
  • Verify that the Password and Confirm Password text fields accept the same strings only
  • Verify that a message is displayed in case of different Passwords entered in Password and Confirm Password
  • Verify that a prompt is displayed in case of a Weak Password
  • Verify that hints are provided for each text field on the sign-up page

FAQs

  1. What can be the Test Scenarios for a Login page of a Mobile Application?
    A Mobile Application can have the following test cases:
    Verify that upon a valid username and password. The user can log in.
    Verify the Forgot password functionality.
    Verify that the login page fits the mobile screen. 
    Verify that the user does not have to scroll the page to log in.
     
  2. What is the meaning of a Functional Test Case?
    A Functional Test Case is a case that helps to check the function or feature of a program to receive the desired result.
     
  3. What is the meaning of a Non-Functional Test Case?
    A Non-Functional Test Case is a case that is not covered under the functional test case. This case generally deals with performance, scalability, and usability.
     
  4. What is the meaning of a Performance Test Case?
    The Performance Test Case is a case that checks the application's performance. It usually considers the time taken by the application during various loading operations.
     
  5. What is CAPTCHA Test Case?
    A CAPTCHA Test Case is a case that helps verify the working of browser cookies and CAPTCHA-based verification.

Key Takeaways

We learned about Authentication Testing in an application's Login Page in this article. We also learned the various types of tests performed during the final verification of a home page with multiple test scenarios. However, this isn't enough, as there is always much more to explore and learn about this vast field of Web Development. To know more, check out our articles related to Web Development or enroll in our highly curated courses.      

Live masterclass