Email Validation Test Cases

How to Write Email Validation Test Cases

In this how-to, we will walk through how to write sample email validation test cases. Many applications collect your email id. Some examples of applications include purchasing on eCommerce websites, scheduling an appointment, or buying tickets to a concert. As a result, creating email address field validation test scenarios applies to all testers. Follow along with this how-to and finish your application’s first test case by creating your free account in our test case management tool. Before starting our test case, we must define the Acceptance Criteria or watch the complete guide.

Watch the Complete Guide Video for Creating Email Id Tests

Watch the video tutorial below to learn the process for validating email addresses/email Ids. The video covers everything you need to do in your daily job.

What are the Acceptance Criteria for email address validation test cases?

As discussed in our requirements post, we must have functional requirements. So let’s go ahead and define them as such:

Description: “User must be able to enter their email id while registering their account.

Abbreviated Acceptance Criteria:

What are the Test Cases for Email Address Validation?

Email App on Phone

Positive Scenarios:

  1. Verify the input field accepts a valid email address. Some examples:
    1. example@email.com
    2. example.first.middle.lastname@email.com
    3. example@subdomain.email.com
    4. example+firstname+lastname@email.com
    5. example@234.234.234.234
    6. example@[234.234.234.234]
    7. “example”@email.com
    8. 0987654321@example.com
    9. example@email-one.com
    10. _______@email.com
    11. example@email.name
    12. example@email.museum
    13. example@email.co.jp
    14. example.firstname-lastname@email.com
    15. Valid Email Addresses that appear at glance to be invalid
    16. extremely.”odd\unusual”@example.com
    17. extremely.unusual.”@”.unusual.com@example.com
    18. very.”(),:;<>[]”.VERY.”very@\\ “very”.unusual@strange.email.example.com
  2. Verify email id can contain a dot in the address field.
  3. Verify email id can contain a dot in the subdomain field.
  4. Verify email id can contain a plus sign.
  5. Verify email id can contain an IP address in square bracket.
  6. Verify email id can contain quotes.
  7. Verify email id can contain digits.
  8. Verify email id can contain an underscore.
  9. Verify email id with a valid top-level domain name is valid.
  10. Verify top-level domain can contain a dot.
  11. Verify email id with a dash is considered valid.

Negative Scenarios:

As with all test scenarios, there do exist some negative scenarios you will want to verify. Namely:

  1. Verify an email id cannot exceed 254 characters.
  2. Verify the missing @ symbol in the email id field.
  3. Verify the missing domain in the email id field.
  4. Verify gibberish or garbage is not accepted in the email id text box.
  5. Verify the missing username in the email id field.
  6. Verify encoded HTML within the email id field is invalid.
  7. Verify leading dot in the email id text box is invalid.
  8. Verify trailing dot in the email id text box is invalid.
  9. Verify multiple dots in the email field.
  10. Verify unicode char in the address in the email text box.
  11. Verify invalid IP address format in the email text box.
  12. Verify multiple dots in the domain is invalid.
  13. Verify invalid email addresses like these:
    1. plaintextaddress
    2. @#@@##@%^%#$@#$@#.com
    3. @email.com
    4. John Doe <example@email.com>
    5. example.email.com
    6. example@example@email.com
    7. .example@email.com
    8. example.@email.com
    9. example…example@email.com
    10. おえあいう@example.com
    11. example@email.com (John Doe)
    12. example@email
    13. example@-email.com
    14. example@email.web
    15. example@111.222.333.44444
    16. example@email…com
    17. CAT…123@email.com
    18. ”(),:;<>[\]@email.com
    19. obviously”not”correct@email.com
    20. example\ is”especially”not\allowed@email.com

Testing Diminishing Returns:

Keep in mind there are diminishing returns to testing, and developers should be using a thoroughly tested library or regex for this functionality. Here are some tests some folks might be tempted to run but are not needed.

  1. Verify too many at symbols (@).
  2. Verify all top-level domains.
  3. Verify non-existent top-level domains.

The best thing you can do as a tester is discussing, with the developer, what the library code is doing and what it is not doing. Another quick sanity check is to review your developer’s code on their best laptop for Android Development for the story you are working on. Doing so can help target your testing efforts when testing email address.

Writing Sample Test Scenarios

In this future section, we will go into detail on how to write valid email test scenarios.

AccelaTest - API Testing Simplified

Conclusion for Email Address Field Validation Test Cases

AccelaTest is a test case management tool packed with features that most other testing tools charge a lot of money for. Get your free account now and create your test cases.

Tags: email id test cases, Test cases for email field , Email field test cases, email test cases, email address field validation test cases, email id field test cases, how to write test cases for email id

ACCELATEST UNIVERSITY
Hello there
Do you want to learn the Software Testing techniques, tips, and tricks that have led to a stable, high-paying job and prevented embarrassing multimillion-dollar bugs?
Struggling to write comprehensive test cases?
Hello there
We’ve already created many full-length, ready-to-use tests (this one included) so you don’t have to start from scratch. Plus, our platform makes it easy for you to create your own custom tests quickly and easily.