How to Write Test Cases For Forgot Password and Password?
A login page is important for any website/application to grant secure access to its customers. But do you know what is more important than that? A bug-free login page.
Certainly, no business wants an outsider to come in contact with the private data of other users. And if you run an enterprise that wants to avoid such issues, it’s important to focus on verifying the “password” and “forgot password” fields of the login page.
This exhaustive blog post on writing forgot password test cases is sure to assist you in the development of a login page for your upcoming projects.
Table Of Contents
Test Cases for Password
Although the password is one single field on the login page, you will realize how important it is to create password test cases so your customers are not left confused when they misplace the login credentials. Here is a list of test cases for the password field that you can follow:
- Verify if a valid password is allowing users to successfully log in to their accounts.
- Check if an invalid password entry is preventing users from logging into the account.
- Check if an error message displays when the entered password is wrong.
- Validate that the password field is case-sensitive.
- Verify the size, font, and placement of the password input field on the page.
- Check that the entered password is not visible at first and is hidden by some special characters (dots, asterisk, or such).
- Test if the option to make the password visible (usually, Show Password) is present or not.
- Test if clicking on the Show Password button makes the password visible to the user.
- Validate that the character limit for the password field is accurate and within the range specified in the specification documents.
Test Cases For Forgot Password
Similar to test cases for the password field, there are many test cases for the forgot password option. Knowledge of these different tests will help you run the right cases and scripts to verify the forgot password functionality on the login page. It is an essential requirement that every user will use once. We recommend that you properly understand the value of the forgot password function before building or running the below tests.
|Features under test||Test cases|
|Forgot password link||Check that the forgot password option is visible on the page.|
Verify that the forgot password link is clickable.
Verify that clicking on the link takes the user to the forgot password page.
|Forgot password functionality||Check if you receive an email with a password reset link with valid credentials.|
Check if an error message is displayed when you provide an invalid email address for forgot password.
Verify that you get the password reset link for an already registered email.
Login after resetting the password and see if you can successfully log in.
Test that you receive a confirmation message or email after changing/resetting the password.
Test if the password reset option ensures taking input that follows the guidelines of password creation.
Check and see if the user gets blocked when they try to reset the password beyond a certain number of attempts.
Verify that the reset password link is disabled after the new password is set.
If there are any security questions, check if they are displayed right and take only valid answers.
Verify that the password reset link email is sent only to the particular user’s email.
When to Automate Test Cases For Forgot Password?
Both password and forgot password options have many test cases that call for thorough understanding and attention. Missing out on even one test or its result can prove to be fatal for the entire software. It may give access to an individual who is not the right user or deny entry to the owner of the account. To avoid any of such instances and more of a similar manner and intensity, automating the test cases for the password field along with forgot password option is an essential choice.
You should automate your test cases when:
- There are numerous test cases that require immense manual effort and a high budget.
- Your team has fewer members working on the project.
- There are communication/collaboration issues when testing is done manually.
- You want to avoid human-borne problems.
- It is clear to you that opting for test automation will save you time, money, and the discomfort of working on the same thing again and again.
How to Automate Test Cases For Forgot Password?
For forgot password testing, you can go through the test cases that we have listed above. Here, we will take the example of verifying if the user receives an email upon clicking on the password reset button with the valid email address, with Testsigma as the test automation tool. Below is the Testsigma login page with Forgot Password link.
This is the forgot password page we will request the link from:
Here are the steps on how you can automate the above-mentioned test case for forgot password with Testsigma tool:
Create a new test case with a name and navigation URL.
Create the test steps using NLP dropdowns or the record option available in the tool. Testsigma provides multiple NLP options that you can choose to build the test steps in plain English without any coding.
After you are done creating the tests, run them to see the pass and fail status. In this case, we have provided a valid email address to receive the password reset link, So the status would be Pass. You can also check screenshots and videos of the test to share with the team members.
Lastly, verify that you have received the email with the password reset link in your email. You can further check that the reset link is valid and works properly for you.
Book a demo with us now!
A password is only as strong and safe as it is tested out to be. And if your application or system runs on data that needs proper authorization for user access, logging in with a username and password is intricate to your business. Here comes the need to verify password and forgot password fields with the right set of tests and automation tools.
Both these input fields ask for proper testing. We have listed almost all the necessary tests that you can follow to verify the fields. Also, check out the example we have highlighted with Testsigma and see how you can automate our web, application, and API within minutes without coding a single line.How do you write a test case example? A test case refers to a set of instructions that you need to run to verify certain features/functionality of the system. An example of a test case would be checking the search feature on a site by entering valid and invalid inputs. How do you write a test case for a reset? For a reset functionality, a test case would primarily look like checking the fields with valid and invalid input. Some of the tests would also be sending the right emails with proper reset links. We have discussed reset password test cases above in detail. What are the possible test cases for the login page? For the login page, test cases would include verifying the username and password functionality with positive and negative entries, checking the submit/login button, and validating successful login attempts.