HOW TO TEST FUNCTIONALITIES Flashcards

1
Q

Login Page for a web application. How would you approach testing it? What different types of things would you test?”

Think broadly about functionality, usability, security, performance, and different scenarios (positive, negative, edge cases).

A

Okay, let’s review your answer for testing a Login Page.

You’ve hit on some essential points, which is a great start!

Strengths:

  • Covers Core Functionality: You mentioned positive testing (valid credentials) and key negative testing scenarios (invalid password, empty password field).
  • Error Message Validation: It’s excellent that you specifically called out validating the error messages that appear. This is crucial for user experience.
  • Cross-Browser Testing: Including cross-browser testing shows awareness of compatibility issues.

Areas to Expand For a More Comprehensive Answer:

Interviewers often look for breadth and depth in these types of questions. To make your answer stronger and demonstrate a more thorough approach, consider including these areas:

  1. More Negative Scenarios:
    • Invalid username / valid password
    • Invalid username / invalid password
    • Empty username / valid password
    • Empty username / empty password
    • Case sensitivity tests for username and password (if applicable)
  2. UI/Usability Testing:
    • Are labels (Username:, Password:) clear and correctly associated with fields?
    • Is there placeholder text (e.g., “Enter your username”) and does it disappear correctly?
    • Does the Tab key navigate through the fields in the correct order?
    • Is the design responsive (does it look good and function on different screen sizes/mobile)?
    • Are the buttons (Login, Submit) clearly labeled and clickable?
    • Is there a “Forgot Password?” link? Does it work?
    • Is there a “Sign Up” or “Register” link (if applicable)? Does it work?
    • Password masking: Does the password field show dots or asterisks instead of plain text? Is there a “show password” (eye icon) option, and does it work correctly?
    • Accessibility: Can it be navigated using a keyboard only? Is it compatible with screen readers (basic checks)?
  3. Security Testing (Basic Checks):
    • Is the login page served over HTTPS?
    • Does the password field prevent autocomplete or prompt the browser’s password manager correctly?
    • Test for basic SQL injection vulnerabilities in the username/password fields (e.g., using a single quote ').
    • Brute-force prevention: Does the system lock the account or require CAPTCHA after several failed login attempts?
  4. Boundary/Edge Cases:
    • Test with very long valid/invalid usernames and passwords.
    • Test with usernames/passwords containing special characters (if allowed/disallowed).
  5. Functionality Specifics:
    • If there’s a “Remember Me” checkbox, test its functionality (does it keep you logged in after closing/reopening the browser? Does it not keep you logged in if unchecked?).

Structuring Your Answer:

In an interview, you could structure your answer by category to show methodical thinking:

“Okay, to test a login page, I’d approach it by considering several categories:

  • Functional Testing: First, I’d cover the basics - positive testing with valid credentials to ensure successful login. Then, numerous negative scenarios like invalid username/password combinations, empty fields, case sensitivity… I’d also specifically validate error messages for clarity and correctness.
  • UI/Usability Testing: I’d check the layout on different screen sizes (responsive design), ensure labels and placeholders are correct, test tab navigation, check password masking, and verify links like ‘Forgot Password’.
  • Security Testing: I’d verify HTTPS is used, check for basic vulnerabilities like SQL injection in the fields, and test for account lockout mechanisms after multiple failed attempts.
  • Compatibility Testing: As mentioned, I’d perform cross-browser testing on major browsers like Chrome, Firefox, Safari, and Edge. Depending on requirements, I might also check different operating systems or mobile devices.
  • Performance Testing (Optional): If relevant, I might consider basic checks on how quickly the login process responds.”

Summary:

Your answer covers the fundamental functional tests. To impress an interviewer, expand into UI/Usability, Security, more negative/edge cases, and consider structuring your answer by test type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How would you automate a Test scenario where you need to check if an email is sent after a user registration?

A

Approach: I’d combine UI and API/email testing:
UI Steps: Automate the registration process using Selenium:
Fill out the registration form.
Submit it.
Verify a success message on the UI (if present).
Email Verification: Use an email service API (e.g., Mailinator, Gmail API) or a temporary inbox:
Access the inbox tied to the test email address.
Search for the email using subject, sender, or timestamp filters.
Assert the email’s presence and optionally check its content (e.g., welcome message, link).
Alternative: If email content isn’t accessible, use an API call to verify the email trigger in the backend logs (with developer support).
Key Point: I’d ensure the test is independent by using disposable email addresses and avoid delays with polling mechanisms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How would’ve you automated login functionality for a website?

A

Approach: I’d use a tool like Selenium WebDriver with a language like Java or Python:
Identify login elements (username field, password field, login button) using reliable locators (e.g., ID, name).
Create a page object class (e.g., LoginPage) with methods like enterUsername(), enterPassword(), and clickLogin().
Write a test case to:
Navigate to the login page.
Input valid credentials (stored securely, e.g., in a config file or environment variables).
Click the login button.
Verify successful login (e.g., check for a dashboard element or URL change).
Add assertions to validate outcomes and handle exceptions (e.g., invalid credentials).
Key Point: I’d ensure reusability by making the login method generic and secure by avoiding hardcoded credentials.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly