How would you test a login page?
What the interviewer wants to hear
- Positive cases with valid credentials
- Negative cases: wrong password, unknown user, empty fields
- Boundary and input validation, including special characters
- Security checks: lockout, password masking, no user enumeration, HTTPS
- Usability and accessibility: keyboard, labels, error messages
- Session behaviour: remember me, logout, forgot password
Model answer
I would first check requirements: login with email or phone, password rules, lockout policy, and whether there is OTP or social login. Positive tests: valid credentials log in and land on the right page. Negative tests: wrong password, unregistered email, empty fields, spaces around the email, very long input, and special characters, including SQL injection and script strings to see they are handled safely. Security checks: the password is masked, the site uses HTTPS, the error message does not reveal whether the email exists, and the account locks or slows down after repeated failures. Session tests: remember me, logout clears the session, the back button after logout does not show private pages, and forgot password works end to end. I also test on mobile and different browsers, with keyboard only, and with a screen reader to check labels and error announcements.
Can you answer it under time pressure?
Take a timed easy round and get scored on every answer.
More easy QA Engineer questions
- What is the Software Testing Life Cycle (STLC) and how does it fit with the SDLC?
- How do you decide which test cases go into a regression suite?
- What does a QA engineer do in an Agile Scrum team?
- Explain positive and negative testing with an example.
- Walk me through the life cycle of a defect, from the moment you find it until it is closed.
- What is the difference between a test scenario and a test case? Give an example of each.
- How would you test a file upload feature that accepts PDF documents up to 10 MB?
- Explain boundary value analysis and equivalence partitioning, and show how you would use them together on a field.
- How do you plan and run an exploratory testing session, and how do you report what you found?