If I only enter special character in that field or only digits in that field will this be considered a negative test case? And the test won't pass?
No, this is not a "negative test." As you have stated, the requirements for this field are inclusive of 0-9, a-z, A-Z, chars. If you enter all numbers or all special characters, you are doing a positive test case that satisfies the feature requirements. So, the test passes!
Now, you are likely considering this a "negative" test as "Q@$%#^%#$&&&" doesn't seem like a readable input value. In this case, you are correct.
What is considered a "negative test case" in an input field?
- Tests that don't map to the written list of requirements. A lot of requirements are written in a positive way, and use cases that are not listed in the requirement may not be coded correctly. This is an argument for Implicit versus Explicit Requirements.
- User input that isn't considered in the design/code. For example, you input "all blank spaces." If the code isn't stripping spaces, this is a bug. Or, on an "age" input field, accepting negative numbers is a bug! (In fact, I saw this today!)
- Exercising the input to prompt error messages. This is considered negative due to showing the error message. Users don't necessarily expect error messages. Some users think it's broken if they encounter an error message, so ensure the message is helpful to the user.
- Destructive tests are another form of negative test cases.
- Input that is outside the scope of boundary values. For example, if your input field only allows &()-_"' special characters, then any character other than those is outside the boundary value scope.
- Anything unexpected
- Blank or missing input data when it's a required field