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.

How to complete a message box?

HanKosterHanKoster Members
edited April 2013 in Sahi - Open Source
I am testing a system that uses message boxes to ask confirmation of action.
I get the choice between OK and Cancel.
When I click that button, it is not recorded
What is the statement to insert in my sahi script to click the OK or Cancel button in the message box?

Best Answer

  • HI,


    Please use _expectConfirm() API.

    See the documentation for the same at :http://sahi.co.in/w/_expectconfirm

    Note: Use this API before who triggers this message box.

    like this
    _expectConfirm("Some question?", false);
    _click(_button("Click For Confirm"));

    Regards,
    Pratik Shah
Sign In or Register to comment.