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.

POPUP ISSUE after close

nizar.salhajinizar.salhaji Members
edited April 2011 in Sahi - Open Source
Hi,

I use Sahi since one weeks and I have a problem but I don't know how fixe it.

Description of situation:

_click(_span("Cocoon (3)"));
_click(_checkbox("editCart{BA9BAA4A-2F8B-4962-90BA-514615BBFE1D}"));
_click(_link("Download"));
_popup("extract")._click(_radio("taskId2"));
_popup("extract")._click(_link("Download"));
_exists(_heading1("Download")); // ERROR


Description of this scenario

When I click on _popup("extract")._click(_link("Download")); a progress bar is displayed and after some seconds; Sahi download attachement file; and popup called "extract" is closed automatically.


When I playback this script I have this error in Sahi controller:

[Exception] TypeError: window.top.opener is null


Test environement

Sahi Pro
OS: XP SP3
Browser: FF, IE and Chrome


Thanks for your help.

Comments

  • nizar.salhajinizar.salhaji Members
    edited April 2011
    Any idea ? Any suggest ?

    Thanks for help.
  • narayannarayan Administrators
    Hi Nizar,

    If you wish to assert that the heading exists, then do this:

    _popup("extract")._assertExists(_heading1("Download"));

    Regards,
    Narayan
  • nizar.salhajinizar.salhaji Members
    edited April 2011
    Hi Narayan,

    In fact, I have a download link in my Web Site. When I click on this link, an "extract" popup are displayed with some options.
    When I validate my choices, a progress bar are shown.
    After some minutes, the "extract" popup is closed automatically and I'm prompted (by Windows) to save as file in a destination of my choice. 

    So, in Sahi script I need to find how can I wait (or test) if popup is closed. 

    I test severals way:

    1- _wait(300000, _lastDownloadedFileName() != null) -> FAIL

    2- _wait(300000, !_exists(_popup("extract")._heading1("Download")) -> FAIL

    3- _wait(300000, !_exists(_heading1("Download")) -> FAIL

    Thanks for your help. 

    Regards,
    Nizar.
  • I replace _wait by this function:

    function testName() {
    while (_lastDownloadedFileName() == null) {
    _log("not donwloaded", "success");
    }
    _log("donwloaded", "success");
    }

    In Sahi Controller, I have:

    ...
    _popup("damextractor")._click(_link("Download"));
    setServerVar('___lastValue___1303296037610', _lastDownloadedFileName());
    _log("not donwloaded", "success"); // AFTER WHILE CONDITION

    setServerVar('___lastValue___1303296039610', _lastDownloadedFileName());
    _log("not donwloaded", "success"); // AFTER WHILE CONDITION

    setServerVar('___lastValue___1303296041610', _lastDownloadedFileName()); // EVALUATE WHILE CONDITION

    And after the script stay blocked.

    any idea ? any suggest ?

    Thanks for any help
  • nizar.salhajinizar.salhaji Members
    edited April 2011
    any update ? any suggest ?

    Thanks for any help
Sign In or Register to comment.