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.

Modal dialogs

betsybetsy Members
edited November -1 in Sahi - Open Source
Any luck with handling Modal Dialog Boxes???

Would like to have some insight on handling modal dialog boxes
with sahi...

The Function code that generates the modal dialog box is as below:-
function putComments()
{
var val="";
// it does not allow to close the window until comment
is entered
while(val=="" || val==null)
{
if (window.showModalDialog){
val=showModalDialog("comments.jsp",window,"dialogHeight: 230px;
dialogWidth: 370px; dialogTop: 200px; dialogLeft: 304px; edge:
Sunken;
center: Yes; help: No; resizable: Yes; status: No;");
}else{
val= "Due to browser restriction we
can not take the comment."
}
}
document.forms[0].txtComment.value=val;
}
I have a Button which calls a submit function which in turn results in an OK-Cancel popup. As soon as the user clicks on Ok, the modal dialog shows up where the user has to type in some comments and click on save. This in turn initiates a simple OK popup. I need to attach to this modal dialog and perform the required actions as well as handle all the popups on the way...

-Betsy Joy.

Comments

  • narayannarayan Administrators
    Betsy,

    Sahi works with modal dialogs. Can you please specify the problem you are facing?

    Regards,
    Narayan
  • betsybetsy Members
    Hi Narayan,

    My issue with the Script I recorded is that it works fine with Internet Explorer but when the same script is executed on Mozilla Firefox, a popup which says "Unresponsive Script" comes up on a click action. Also a message "Firefox prevented this site from opening 9616 pop-up windows" comes up. The number of pop-ups varies each time the script is executed.

    Thanks,
    Betsy Joy.
  • narayannarayan Administrators
    Wow! 9616 popups seems quite serious! Can you email the script and screen shot of the page to support@sahi.co.in. We will have a look at it and get back to you. Could you also send along the code which calls putComments()?

    Thanks,
    Narayan
  • betsybetsy Members
    Sent the below files:-

    1) Screenshot of Exception
    2) Script being used
    3) Source code for page
    4) Screen-shot of the page

    Thanks,
    -Betsy Joy
  • betsybetsy Members
    Still waiting!!!
  • narayannarayan Administrators
    Hi Betsy,

    Thanks for the patience. It will take a bit more time though. Give us a day more please.

    Regards,
    Narayan
  • Any Updates on ModalDialog Using Sahi. We are facing a similar issue
Sign In or Register to comment.