Skip to main content

Test Cases for Valid and Invalid Email Address

  • Here is the list of valid and invalid email format which can be used for testing. 
  • The list is not comprehensive by any means and is probably missing a bunch of edge cases. 
  • However, it provides enough coverage for the majority of the allowed/disallowed email address according to RFC 2822
  • BTW, if anyone else would like to contribute more cases to this list, or spot errors (fingers crossed), please feel free to let me know and I'll make sure the list is up-to-date.

Valid Email addressReason
email@domain.comValid email
firstname.lastname@domain.comEmail contains dot in the address field
email@subdomain.domain.comEmail contains dot with subdomain
firstname+lastname@domain.comPlus sign is considered valid character
email@123.123.123.123Domain is valid IP address
email@[123.123.123.123]Square bracket around IP address is considered valid
"email"@domain.comQuotes around email is considered valid
1234567890@domain.comDigits in address are valid
email@domain-one.comDash in domain name is valid
_______@domain.comUnderscore in the address field is valid
email@domain.name.name is valid Top Level Domain name
email@domain.co.jpDot in Top Level Domain name also considered valid (use co.jp as example here)
firstname-lastname@domain.comDash in address field is valid

Invalid Email addressReason
plainaddressMissing @ sign and domain
#@%^%#$@#$@#.comGarbage
@domain.comMissing username
Joe Smith <email@domain.com>Encoded html within email is invalid
email.domain.comMissing @
email@domain@domain.comTwo @ sign
.email@domain.comLeading dot in address is not allowed
email.@domain.comTrailing dot in address is not allowed
email..email@domain.comMultiple dots
あいうえお@domain.comUnicode char as address
email@domain.com (Joe Smith)Text followed email is not allowed
email@domainMissing top level domain (.com/.net/.org/etc)
email@-domain.comLeading dash in front of domain is invalid
email@domain.web.web is not a valid top level domain
email@111.222.333.44444Invalid IP format
email@domain..comMultiple dot in the domain portion is invalid


Comments

Popular posts from this blog

XPath for Selenium WebDriver

How to create Xpath locators...? What are the different types of XPath? There are two kinds of XPath expressions- Absolute XPath   - The XPath expressions created using absolute XPaths begins the selection from the root node. These expressions either begin with the '/' or the root node and traverse the whole DOM to reach the element. Relative XPath   - The relative XPath expressions are a lot more compact and use forward double slashes '//'. These XPaths can select the elements at any location that matches the selection criteria and doesn't necessarily begin with the root node. The ways of finding dynamic elements using XPath... What is an XPath? An XPath can be defined as a query language used for navigating through the XML documents in order to locate different elements. The basic syntax of an XPath expression is:-  //tag[@attributeName='attributeValues'] the different elements in the Xpath expression syntax - tag , attribute and at...