18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Captcha handling

stefanxstefanx Members
edited November -1 in Sahi - Open Source
Hi!
As mentioned in a few posts before Sahi does not "crack" CAPTCHAs. This is fine but instead I am looking for a way how to integrate a manual step in a test script. I would like to define a certain step in a script where Sahi extracts a CAPTCHA from the website, presents it to the user, and retrieves the CAPTCHA code from the user for further usage.

Do you know any easy way how to implement this?

Comments

  • narayannarayan Administrators
    Try this:

    Open sahi/config/normal_functions.txt
    Add _prompt at the end.
    restart Sahi.
    (The above step is to make _prompt be recognized by Sahi properly. In future releases, it will be added by default.)

    Then use this in your script.
    // Your initial steps
    _setValue(_textbox("your_captcha_textbox"), _prompt("Enter captcha manually"));
    // Your further steps
    
  • I am quite new to Sahi but a single line of changed code impress me.

    Thank you! :-)
  • narayannarayan Administrators
    Glad you are impressed :) But the truth is that _prompt was a function which was already implemented. It was just not exposed because I did not see any need for it. But your case seemed to indicate I should expose that API too.
  • Hi Narayan,

    I'm new to your app, and ahving tried Automate, WinTask and iOpus, I was looking for an ALT with more flexibility.

    I too was looking hard for the "prompt" for variable feature, which is in fact in the "API list" combo box, but would not work until I added the line in the "normal_functions.txt" file.

    While the question clearly says "Enter captcha manually" as you have indicated in this forum, I was wondering if it was possible to CHANGE the prompt "window title", since right now, it displays the websites URL?

    Also, is there a way I can use the "_prompt" API to set a variable?


    Thanks Narayan.
Sign In or Register to comment.