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:
- Validate the email address must be entered in the expected format.
- Validate error messages are thrown when invalid data is entered.
What are the Test Cases for Email Address Validation?
Positive Scenarios:
- Verify the input field accepts a valid email address. Some examples:
- example@email.com
- example.first.middle.lastname@email.com
- example@subdomain.email.com
- example+firstname+lastname@email.com
- example@234.234.234.234
- example@[234.234.234.234]
- “example”@email.com
- 0987654321@example.com
- example@email-one.com
- _______@email.com
- example@email.name
- example@email.museum
- example@email.co.jp
- example.firstname-lastname@email.com
- Valid Email Addresses that appear at glance to be invalid
- extremely.”odd\unusual”@example.com
- extremely.unusual.”@”.unusual.com@example.com
- very.”(),:;<>[]”.VERY.”very@\\ “very”.unusual@strange.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.
Negative Scenarios:
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:
- plaintextaddress
- @#@@##@%^%#$@#$@#.com
- @email.com
- John Doe <example@email.com>
- example.email.com
- example@example@email.com
- .example@email.com
- example.@email.com
- example…example@email.com
- おえあいう@example.com
- example@email.com (John Doe)
- example@email
- example@-email.com
- example@email.web
- example@111.222.333.44444
- example@email…com
- CAT…123@email.com
- ”(),:;<>[\]@email.com
- obviously”not”correct@email.com
- 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.
- Verify too many at symbols (@).
- Verify all top-level domains.
- 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.
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