In our project we have a user to sign on after filling the CAPTCHA code. Right now it's working fine and I am a beginner to this field.
I am confused how to write a test case for the CAPTCHA code
|
In our project we have a user to sign on after filling the CAPTCHA code. Right now it's working fine and I am a beginner to this field. I am confused how to write a test case for the CAPTCHA code |
|||||||||||
|
|
Many of the preceding answers are directed at testing the behavior of the captcha from a customers POV (enter valid, invalid, etc.). But, if you are testing an actual captcha generator that your dev's wrote then you should go deeper. Also, there is some important information about the captcha generator you're testing that would be important for functional testing. For example,
Some other information needed for behavioral testing from the UI could include
|
|||||||||||
|
|
For me the CAPTCHA consists of different sub-modules:
If implemented via interfaces (dependency injection) you can test some functionality in isolation:
|
||||
|
|
|
Example for manual testing, if you mean it:
|
||||
|
|
|
The purpose of a CAPTCHA is to verify a human is submitting the form. By definition, if you could automate this interaction, the functionality would fail. But you didn't ask about automation, so that's just an aside. Think about it from a functional perspective - does it let you submit when you enter the right input? Does it keep you out if you don't enter the right input? What kinds of invalid input might trick it into letting you in? Think about it from a usability perspective - is the CAPTCHA easy enough for a human to read? Is it still tough enough for a program to detect and read? Do some research about CAPTCHAs and how they've been known to succeed and fail. That may give you ideas about how to test. Have a look at this testing Cheat Sheet for some more ideas. If you're a beginner, it may help you with future tests too. http://testobsessed.com/wp-content/uploads/2011/04/testheuristicscheatsheetv1.pdf |
|||
|
|
|
There are two questions here: (1) test case itself; (2) ability to automate testing. As per the first topic, you just describe it in a form of
or, alternatively (depending on your policy of writing TC's):
Automating this process is slightly different. Since the key to testing is ability to reproduce, you can't afford different CAPTCHA's within the same test. However, you can (and should) make tests for valid, invalid, empty responses. For this purpose, you should develop a dummy CAPTCHA provider that will have exactly the same interface as the "production" CAPTCHA provider has, but will return only a well-known image(s). |
|||||
|