How to automate and verify password authentication using selenium and java: password should be accept minimum 6 char with at least one number and one special char are must require ?.
Basically you will check if the application behaves correctly when valid and invalid passwords are tried.
When using a valid password, the system goes to the landing screen/page;
When using a invalid password, the system displays same error message (and maybe logs the event in a logging database);
You can check a description of scenarios that I wrote for validating a login page here.
You can either use a fixed set of valid and invalid passwords or generate the inputs using a modal-based testing tool like OSMO.
Random people on the Internet can't tell you what your password policy should be.
If you own defining the policy, you should know there there are different schools of thought on password restrictions; see for example https://security.stackexchange.com/questions/29836/what-are-good-requirements-for-a-password.
If you are a tester, you should ask for the policy the software is supposed to enforce.
I would use a regex pattern match. I'm not a guru in this, but there seems to be a good answer in SO here.
To save the extra click, @Srinivas' closest answer is:-
Minimum 8 characters at least 1 Uppercase Alphabet, 1 Lowercase Alphabet, 1 Number and 1 Special Character:
It will take some playing with, but that should get you what you are after.