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.

IE 8 with ant task suite

cateamcateam Members
edited November -1 in Sahi - Open Source
Namaste,

We are currently working on a suite with Ant. Everything is working fine except that with IE8 browser, we have a login page which open a popup window & once the popup window is opened, it's trying to close the previous login page. The problem is that when it's trying to close the login page, the script isn't going further as long as we do not close the browser page.
We have a popup Windows Internet Explorer :
The webpage you are viewing is trying to close the window. Do you want to close this window?

How can we avoid that our sahi suite through ant ask to close this window or how can we press Yes or No to let the scenario continues ?

Remarks : this is not happening when we are using the Sahi controller.


FYI:
OS name : Windows server 2008
Browser name : IE 8
Sahi V3.5 (25-05-2011)

Comments

  • SumitraSumitra Members
    Hi cateam,

    Are you telling that the popup is not closing the login page when you are using the Sahi Controller.

    Also, let me know if you application itself is closing the login page after the pop window is opened.

    Regards
    Sumitra
  • cateamcateam Members
    Namaste Sumitra,

    In fact, the situation is the following :

    1) we open a login page and insert login/password
    2) Once the login/password approved, a prompt window appears

    We would like reply at this prompt window "Yes", by this way the rest of the script will continue to be executed correctly.

    I hope you see what I mean :-), we would like just click on "Yes" on this prompt window?

    Do you know please how we do that ? :-)

    Maybe we can send you a screenshot by email.

    Thanks again for your help.
  • SumitraSumitra Members
    Hi cateam,

    You can use:

    _expectConfirm(message, boolean) ;

    For more Details:

    http://sahi.co.in/w/_expectConfirm

    Check if this solves your issue.

    Regards
    Sumitra
  • cateamcateam Members
    Hi Sumitra,

    Thanks a lot for your reply :-).

    _expectConfirm(message, boolean) is really interesting, unfortunately it doesn't work maybe because we don't use it correctly.

    The confirm message we have is like this :

    "The webpage you are viewing is trying to close the window.

    Do you want to close this window?"

    As you can see there is a carriage return between the two lines.

    Here below a screenshot :
    viewer.php?id=859441screenshot.jpg

    We know it is necessary to put the entire confirm message in parameters of _expectConfirm(message, boolean) but how to do when we have carriage return in the message ?

    Thanks a lot
  • SumitraSumitra Members
    Hi cateam,

    Yes,its necessary to put thr entire comfirm message in parameters of _expectConfirm(message, boolean).

    You can use:

    _expectConfirm("The webpage you are viewing is trying to close the window.\r\nDo you want to close this window?");

    Regards
    Sumitra
  • narayannarayan Administrators
    Sumitra,

    This is not a confirm dialog. This is triggered sometimes during window.close. Cateam, could you please send us the reproduction steps so that we can see how to fix it. You may also try getting the latest Sahi and running it. We had fixed one issue related to IE window close recently.

    Regards,
    Narayan
  • cateamcateam Members
    edited July 2011
    Hi Sumitra, hi Narayan,

    Thanks for your help.

    After installing the last version of Sahi, nothing changed :-(.

    Narayan is right, this window is not a standard confirm message after some research on the web.

    We try the below function :

    <browser>
    window.open('','_self');
    </browser>


    I don't know how it works but as per my last tests, it works, the window disappears automatically and our script continues.

    Do you have any idea ?


    Narayan, you asked us to send you the reproduction steps, what do you mean please ?
    Do you want our entire script or do you want we provide you logs after testing the script manually through the Sahi Dashboard ?

    I ask that because this particular window is not present when we execute our script, without ANT, directly in Sahi Dashboard. You see what I mean :-)

    Only present through ANT execution, strange, doesn't it ? :-D


    We are waiting your reply and I hope we will be able to solve this issue together :-)

    Have a nice day.
  • narayannarayan Administrators
    Hi cateam,

    The window.open('','_self'); is what we also use in _closeWindow(). This hack is needed on IE, and works well for us too.

    The only change I would suggest is to not have the code in a browser tag, since it will then get executed on all pages.

    Try this before you click login:

    _call(window.open('','_self'));
    _click(_button("Login")); // or what ever your login button is.

    By reproduction steps, I meant the script and the website URL on which it fails. But since you have have told us what the problem is, we don't need it anymore.

    Regards,
    Narayan
  • mohanmohan Members
    edited July 2011
    Thanks cateam & Narayan,

    your research solves the same issue i faced during login. Narayan you please add this fix in to FAQ or Some thing like Knowledge base . because these issues are faced by many when they are new to sahi. you can ask them first go and search the kb list with keywords , if they cant find a solution then they can create a new support request.
Sign In or Register to comment.