This tutorial will show you how to create email validation test cases. Many applications will collect your email ID. You can purchase tickets, schedule an appointment, and book online on eCommerce sites. All testers should be able to create validation scenarios for email addresses.
The email field is where you send a message to someone. The subject usually includes the sender’s name and the receiver’s. This field can also be used to write other messages or images.
Before we can start our test case, it is important to establish the Acceptance Criteria
What is the Acceptance Criteria in email address validation cases?
We must have functional requirements, as we discussed in requirements post. Let’s define them.
Description: The user must be able enter their email id when they register their account.
Abbreviated Acceptance Criteria
- Validate the email address must be entered in the expected format.
- Invalid data can result in valid error messages.
What are the test cases for email address validation?
- Verify the input field accepts a valid email address. Some examples:
- Valid Email Addresses that appear at glance to be invalid
- very.”(),:;<>”.VERY.”very@\\ “very”.email@example.com
- Verify email id can contain a dot in the address field.
- Verify email id can contain a dot in the subdomain field.
- Verify email id can contain a plus sign.
- Verify email id can contain an IP address in square bracket.
- Verify email id can contain quotes.
- Verify email id can contain digits.
- Verify email id can contain an underscore.
- Verify email id with a valid top-level domain name is valid.
- Verify top-level domain can contain a dot.
- Verify email id with a dash is considered valid.
As with all test scenarios, there do exist some negative scenarios you will want to verify. Namely:
- Verify an email id cannot exceed 254 characters.
- Verify the missing @ symbol in the email id field.
- Verify the missing domain in the email id field.
- Verify gibberish or garbage is not accepted in the email id text box.
- Verify the missing username in the email id field.
- Verify encoded HTML within the email id field is invalid.
- Verify leading dot in the email id text box is invalid.
- Verify trailing dot in the email id text box is invalid.
- Verify multiple dots in the email field.
- Verify unicode char in the address in the email text box.
- Verify invalid IP address format in the email text box.
- Verify multiple dots in the domain is invalid.
- Verify invalid email addresses like these:
- plaintext address
- John Doe <firstname.lastname@example.org>
- email@example.com (John Doe)
- example\ is”especially”not\firstname.lastname@example.org
Test Diminishing Returns
Remember that testing has diminishing returns and developers should use a well-tested library or regex to test this functionality. These are just a few tests that people might want to run but they are not necessary.
- Too many symbols (@). must be verified
- Verify all domains at the top.
- Verify that there are no top-level domains.
As a tester, it’s important to discuss with the developer what the library code does and doesn’t do. This will help you target your testing efforts for testing email addresses.
What is the validation for email?
Email validation is a method to determine if an email address can be reached and is valid. It quickly detects typos and determines whether they are genuine errors or intentional misdirection. It checks whether an email address is associated to a trusted domain.