QTP/UFT support tip: Can CAPTCHA objects be automated?
There are application that have a CAPTCHA object.
CAPTCHA objects are the controls that display random text characters that the user needs to read and enter to move forward in an application. For more information on CAPTCHA objects, refer to http://www.captcha.net/.
CAPTCHA objects are designed to prevent automation, by ensuring that a human is interacting with the application, not a computer. These controls are designed to prevent automation. With this in mind, QuickTest Professional (QTP) / Unified Functional Testing (UFT) does not have a method to capture the text from the object. You will most likely need to test that portion of the application manually.
Here are a couple suggestions you can consider:
-If possible, limit the CAPTCHA control (during the testing phase) to only a few words/letter combinations. Then use QTP/UFT to cycle through these defined words/combinations. Again, this limitation on the control would only need to be done in the testing phase.
-If possible, ask your developers to add a method which will capture the characters used in the CAPTCHA control at runtime. Then, have QTP/UFT call that method, retrieve the text, and enter it into the field as needed. Once again, this method would only need to be in place while the testing the application.
-If possible, ask your developers to add a flag that will allow you to bypassthe control during the testing phase.
Depending on the settings used within the CAPTCHA control, you may be able to use another application (for example, OCR software) to read the text from the image and return that text to QTP/UFT. Once QTP/UFT has the text, it can be entered into the field.
If you find this useful, mark Kudos.
Note: The Opinions expressed in my post are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any answered posted.
Re: QTP/UFT support tip: Can CAPTCHA objects be automated?
I have not tried this yet but, there is a new feature/enhancement that was recently added to UFT 12.01 using GetVisibleText method for Insight Objects to retrieve text using OCR mechanism. It it works, that should solve this issue with Captcha controls.
Also, the CaptureBitmap can be used to at least capture the characters to type.
I'm still waiting for HP to implement the "Type" method for WebEdit controls which would simulate the actual keyboard typing. The combination of that GetVisibleText plus the Type methods should be really nice to have in UFT.