Here are some test cases for OTP (One-Time Password) verification:
1. Check if OTP is generated and sent to the correct user:
- Enter the user's phone number.
- Check if OTP is generated and sent to the entered phone number.
- Expected result: OTP should be sent to the entered phone number.
2. Verify the OTP input field:
- Enter OTP in the input field.
- Check if the input field only accepts numbers.
- Expected result: Only numbers should be accepted in the input field.
3. Verify OTP length:
- Check if the length of the OTP is 6 digits.
- Expected result: OTP should be 6 digits long.
4. Verify OTP expiration time:
- Check if the OTP is valid for a limited time.
- Check if the OTP becomes invalid after the expiration time.
- Expected result: OTP should be valid for a limited time and become invalid after the expiration time.
5. Check if OTP is verified successfully:
- Enter OTP in the input field.
- Check if the OTP is verified successfully.
- Expected result: OTP should be verified successfully.
6. Check if incorrect OTP is rejected:
- Enter an incorrect OTP in the input field.
- Check if the incorrect OTP is rejected.
- Expected result: Incorrect OTP should be rejected.
7. Check if the user can request another OTP:
- Check if the user can request another OTP if the first OTP was not entered correctly.
- Expected result: The user should be able to request another OTP.
8. Check if OTP is sent to multiple devices:
- Check if OTP can be sent to multiple devices for a single user.
- Expected result: OTP should be able to be sent to multiple devices.
9. Verify the OTP input field with special characters:
- Enter special characters in the OTP input field.
- Check if the input field only accepts numbers.
- Expected result: Only numbers should be accepted in the input field, special characters should be rejected.
10. Check if the user can resend OTP:
- Check if the user can resend OTP if it was not received.
- Expected result: The user should be able to resend OTP.
11. Check if the OTP input field has a character limit:
- Enter more characters than the limit in the OTP input field.
- Check if the input field only accepts 6 digits.
- Expected result: The input field should only accept 6 digits.
Recommended by LinkedIn
Safeguarding Integrity: The Imperative of ITGC and… Nikhil Singhvi Jain S 🇮🇳 (Doctoral Student, CISM, CISA,CCSFP-CHQP, ISMS LA) 3 months ago Digital payments impacting everyday life – What must… RS Software 1 year ago
How Modern Dialer Solutions Can Help Address… Convoso 4 months ago
12. Verify the OTP validation process:
- Check if the OTP is validated on the server-side.
- Expected result: OTP should be validated on the server-side.
13. Check if OTP input is case-insensitive:
- Enter OTP in different cases in the input field.
- Check if the OTP is accepted regardless of the case.
- Expected result: OTP should be accepted regardless of the case.
14. Check if OTP is sent to the correct country code:
- Enter the user's phone number with a different country code.
- Check if the OTP is sent to the correct country code.
- Expected result: OTP should be sent to the correct country code.
15. Check if the OTP input field is disabled after successful verification:
- Enter the correct OTP in the input field.
- Check if the OTP input field is disabled after successful verification.
- Expected result: The OTP input field should be disabled after successful verification.
16. Check if a user is notified of OTP resend:
- Request another OTP.
- Check if the user is notified that a new OTP has been sent.
- Expected result: The user should be notified that a new OTP has been sent.
17. Check if the OTP input field is disabled after a certain number of attempts:
- Enter incorrect OTP multiple times.
- Check if the OTP input field is disabled after a certain number of attempts.
- Expected result: The OTP input field should be disabled after a certain number of attempts.
18. Check if the user is locked out after a certain number of attempts:
- Enter incorrect OTP multiple times.
- Check if the user is locked out after a certain number of attempts.
- Expected result: The user should be locked out after a certain number of attempts.
🔰 For Testing Purposes Use:
- Live Preview: OTP Verification Test Cases (fagunti.github.io)
Note: This is just an example and not a secure way to implement OTP verification. For source code, comment below.
™Copyright Notice
This article is the property of Mejbaur Bahar Fagun and is protected under copyright laws. No part of this article may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the copyright holder. The views and opinions expressed in this article are those of the author and do not necessarily reflect the official policy or position of any company or organization. This article is for informational purposes only and does not constitute professional advice. The author shall not be held liable for any damages resulting from the use of the information contained within this article. By reading this article, you agree to the terms of the copyright notice. If you do not agree to these terms, please do not read or share this article.
#sqa #qa #sqaengineer #qaautomation #qajobs #qaengineer #qamanual #qatesting #qaanalyst #qaautomationengineer #qatester #qamanualtester #testcase #otp #otptesting #bug #mejbaurbaharfagun #mejbaurbahar #softwaretesting #softwarequalityassurance #softwaredevelopment