FAQs
How to Handle Text-Based CAPTCHA in Testsigma?
Handling CAPTCHA in automation is often challenging, but Testsigma provides a solution for text-based CAPTCHAs using the OCR_ExtractText Addon. This article discusses how to manage text-based CAPTCHA effectively using Testsigma.
Install the Addon
Section titled “Install the Addon”-
From the left navigation bar, click the Addons icon and then select Add-ons.
-
On the Addons page, under New & Updated Addons, click the search icon and search for OCR_ExtractText.
-
When it appears in the results, click Install.
Create an Element for the CAPTCHA Image
Section titled “Create an Element for the CAPTCHA Image”-
From the left navigation bar, go to Create Tests and click Elements.
-
Click Create Element.
-
In the Create Element overlay:
- Enter the element name
- Provide the screen name
- Select the appropriate element type
- Enter the locator value (Xpath or CSS selector for the CAPTCHA image)
-
Click Create Element.
Create a Test Case
Section titled “Create a Test Case”-
From the left navigation bar, go to Create Tests and click Test Cases.
-
In the Test Case Explorer section, expand the required Feature and click the + icon next to the required Scenario. A dialog box appears.
-
In the dialog box, enter the name for your test case and click Create.
Specify the Variable Name
Section titled “Specify the Variable Name”-
In the Test Case Details page, add the following NLP step:
Extract text from the locator element including special characters and store it into a variable.
-
Click on element and select the previously created element for the CAPTCHA image.
-
Click on variable and enter a name for the runtime variable (e.g., capturetext).
Use the Stored Variable in the Input Field
Section titled “Use the Stored Variable in the Input Field”-
In the same test case, add the following NLP step:
Enter the testdata in the element field.
-
Click on testdata and select the runtime variable you created earlier (e.g., $ capturetext).
-
Click on element and select the element created for the CAPTCHA input field.