Email Test Cases: This post will discuss the email test cases for the Email field. The most important part of web testing and development is validating the email ID field. If your website provides a mail-sharing facility or something regarding email ID, you can inject it through email and harm your database. To reduce that risk, email validation should be there.
The email field is the part where we write a message to someone. It usually has the name of the sender and receiver and the subject’s name. We can also write any other message or image into this field.
Post On: | Test Case For Email Id Field |
Post Type: | Test Case |
Published On: | www.softwaretestingo.com |
Applicable For: | Freshers & Experience |
Social Group | Join SoftwareTestingo On Telegram |
Email fields are generally located at the end of the email, and some people like to put messages in there because it saves space on their computer screen or because they want to keep their inbox tidy.
What Is Email Field?
The email field is the area on a webpage where you can insert an email address or field. This may include forms for collecting information about a person or areas for adding comments. Here’s how you can add email fields to your websites.
Test Case For Email ID Field
Email field validation is one of the most critical tasks in any email-sending application. Test Email Validity ensures that each email a user sends has an associated correct address, name, and other required information. This article discusses how email validation test cases can be tested using accurate data and simple examples.
Email Test Cases – UI
- Check the webpage has the email field.
- Check whether the label text of the email field is shown or not.
- Check the label text is aligned with the email field.
- Check whether the placeholder text is added or not.
Functional Email Validation Test Cases
- Check if the email field is accessible by clicking on the email field.
- Check if the user can type the email in the email field.
- Check whether the user can paste the email ID address by the keyboard (CTRL+V) and Mouse (Right Click – Paste)
- Check whether the email validations are applied to the email field or not.
- Check if the error messages display when the user enters an invalid email address.
Positive Test Cases For Email Field
- Check the email field by entering a valid email address. (admin@softwaretestingo.com)
- Check if the email address contains a @ or not.
- Check if the email field accepts + sign in the email address. E.g., softwaretestingo+1@gmail.com
- Check if the email address contains a domain name or not. (admin@softwaretestingo – Here, softwaretestingo.com is the domain name)
- Check whether the email address has the dot (.) or not.
- Check an email address. It should be considered correct if an email contains a subdomain.
- Check that an email address has a maximum of 2 dots in the case of the subdomain.
- Verify if the email address contains special characters; that will be considered valid.
- Check if the email address contains a number that will be considered valid.
- Check if the email address contains the IP address.
- Check the email address contains square brackets, quotes ” “, dash – or underscore _.
Negative Email ID Test Cases
- Check the email ID field without the @ sign and the domain name.
- Check the email ID field without a username.
- Check the email address field. With encoded HTML within the email, it is invalid.
- Check the email ID field with two @ signs.
- Check the email field with leading and tailing dots.
- Check the email ID filed With Unicode char as the address.
- Check the email id text box With the Missing top-level domain (.com/.net/.org/etc.)
Email Validation Test Cases
- Check with all possible scenarios For email in the address field, as it should support alphabet, number, underscore, and Dash. Dot, plus sign, quote, etc., for valid email format.
- The Email field should follow the basic regex format, which is xxxx@xx.xx.
- The error message should be displayed for an invalid and already registered email address.
Valid Email ID Examples
Valid Email address | Reason |
---|---|
email@domain.com | Valid email |
firstname.lastname@domain.com | The email contains a dot in the address field |
email@subdomain.domain.com | The email contains a dot with a subdomain |
firstname+lastname@domain.com | Plus sign is considered a valid character |
email@123.123.123.123 | The domain is a valid IP address |
email@[123.123.123.123] | A square bracket around the IP address is considered valid |
“email”@domain.com | Quotes around email are considered valid |
1234567890@domain.com | Digits in the address are valid |
email@domain-one.com | Dash in the domain name is valid |
_______@domain.com | Underscore in the address field is valid |
email@domain.name | .name is a valid Top Level Domain name |
email@domain.co.jp | Dot in Top Level Domain name also considered valid (use co.jp as an example here) |
firstname-lastname@domain.com | Dash in the address field is valid |
Invalid Test Cases Of Email ID
Invalid Email address | Reason |
---|---|
plain address | Missing @ sign and domain |
#@%^%#$@#$@#.com | Garbage |
@domain.com | Missing username |
Joe Smith <email@domain.com> | Encoded HTML within an email is invalid |
email.domain.com | Missing @ |
email@domain@domain.com | Two @ sign |
.email@domain.com | The leading dot in the address is not allowed |
email.@domain.com | Trailing dot in address is not allowed |
email..email@domain.com | Multiple dots |
あいうえお@domain.com | Unicode char as address |
email@domain.com (Joe Smith) | Text followed email is not allowed |
email@domain | Missing top-level domain (.com/.net/.org/etc.) |
email@-domain.com | The leading dash in front of the domain is invalid |
email@domain.web | .web is not a valid top-level domain |
email@111.222.333.44444 | Invalid IP format |
email@domain..com | Multiple dots in the domain portion is invalid |
Conclusion
The test scenarios for email ID text field is the part of the email where we write a message to someone. It usually has the name of the sender and receiver and the subject’s name. We can test email address fields differently, like sending emails through Gmail, Yahoo, Outlook, or any other email client.
The email field is the part where we write a message to someone. Email Address Testing has the name of the sender and receiver and the subject’s name. In this blog, we have provided some test cases for your reference. If you think about more test scenarios, then you can share those test scenarios in the comment section.
Email address starting (leading point) with special characters so that also consider as not valid format
Note:- gmail is also not allowed this format
Example:- #ankit123@gmail.com